Madrid (CNN) -- Spanish police arrested two suspected terrorists with apparent links to an al Qaeda-affiliated group Tuesday but said they had no indication of an imminent attack.
The Interior Ministry identified the suspects as Nou Mediouni, 23, from Algeria, who was arrested in the north-central city of Zaragoza, and Hassan El Jaaouani, 52, from Morocco, who was detained in the southeastern city of Murcia.
Spanish police worked with their counterparts in France and Morocco to carry out the latest arrests, an Interior Ministry statement said.
The two suspects have a "profile" that is similar to the two suspects in the Boston Marathon attacks, the statement said. Interior Minister Jorge Fernandez Diaz told reporters that police consider them "lone wolves," like the Boston suspects.
However, the similarity is based only on how the two suspects in Spain were "radicalized," by going to online forums and chat rooms, and also in the suspects' alleged interest in pulling from the Internet information on bomb-making, said an Interior Ministry spokesman, who by custom is not identified.
The pair, who are from different countries, are not brothers and, unlike the two suspects in the Boston Marathon attacks, have no roots in the Caucasus region, he said.
But Fernandez said one of the suspects recently praised the Boston attacks. A second Interior Ministry spokesman said that was the younger suspect, Mediouni.
Both of the suspects in Spain are unemployed, the second Interior Ministry spokesman said. Mediouni, arrested in Zaragoza, studied computer sciences but had not worked professionally in that field, the ministry statement said.
The two are suspected members of a radical cell close to the terrorist organization al Qaeda in the Islamic Maghreb, the Interior Ministry said.
The two men have been under surveillance as part of an operation lasting more than a year run in cooperation with France and Morocco, the Spanish Interior Ministry said.
The Madrid train bombings in March 2004, which killed 191 people and wounded more than 1,800, led to a sharp increase in Spain's fight against Islamic terrorism. The courts convicted 14 Islamic militants for their role in the bombings, along with four Spaniards convicted for trafficking in explosives used in the attacks.
Since then, authorities have told CNN that Spain has assigned hundreds of additional police officers to investigate Islamic terrorism and added dozens of Arabic translators, so authorities will be able to understand communications and threats. Around 400 suspected Islamic militants have been arrested in Spain since March 2004, although many have been released by judges for lack of evidence.
Mali extremist contacts alleged
Mediouni was identified and recruited by Mali-based members of al Qaeda in the Islamic Maghreb through his interest in radical Islamist Internet sites, the Interior Ministry statement alleges.
He was given specific instructions for a trip to a jihadist camp in northern Mali led by the group, the Interior Ministry claims, but was unable to meet with AQIM leaders because of the heightened security presence in the area.
Since January, France and nearby African nations have been supporting Malian forces in their efforts to push back Islamist extremists who carved out a large haven in northern Mali last year.
El Jaaouani is also alleged to have established contact with AQIM leaders in Mali and to be responsible for recruiting radicals in Spain. One of the people he contacted was directly involved with the kidnapping and murder of two French citizens in Niger in January 2011, the Spanish Interior Ministry said.
The two suspects' homes were being searched by police, the statement added. They are due to be arraigned Thursday at the National Court in Madrid, which handles terrorism cases, a court spokeswoman said.
The arrests in Spain come days before the Madrid Marathon on Sunday.
About 26,000 runners are expected to take part in a marathon, half-marathon and 10-kilometer race, to be run at the same time. Security has been increased in light of the attacks in Boston, authorities said.
CNN's Claudia Rebaza and Laura Smith-Spark contributed to this report.