MADRID — The Spanish government said on Thursday that it had arrested three men suspected of having links to Al Qaeda and believed to have been planning attacks in Europe.

The Spanish Interior Ministry released photographs of the three but offered only minimal details. The Associated Press, quoting the Spanish police, said that one was Russian, the second a Russian of Chechen descent and the third a Turk. They were arrested as part of a 24-hour police operation carried out between Tuesday night and Wednesday.

The Spanish interior minister, Jorge Fernández Díaz, said in an interview by telephone that the men had been in Spain for about two months and under close surveillance for several weeks. “We have clear indications that an attack was being planned, whether in Spain or another European country or even both,” Mr. Fernández Díaz said.

Image Undated photos of the suspects, released by the Spanish government. The men were identified only by initials, as from left, C.Y., M.A. and A.A.A. Credit... Spanish Interior Ministry, via Associated Press

He would not discuss the suspects’ likely targets, but said that they had received military-style training and were “clearly not acting as lone wolves.” Among the evidence gathered by the police was “documentation about flying ultralight aircraft,” he said.