Madrid (CNN) -- A Spanish judge filed preliminary charges of membership in an Islamic terrorist group against two men arrested this week and ordered that one must remain in jail, a national court spokesman said Friday.
Nouh Mediouni, 23, an Algerian arrested Tuesday in Zaragoza, Spain, was remanded to prison after the closed-door arraignment was held Friday under tight security in Madrid.
The investigating magistrate, Judge Santiago Pedraz, believes that Mediouni intended to go to a training camp of al Qaeda in the Islamic Magreb in 2010 but never made it, yet continued his contact with the terrorist group, including making calls with an individual linked to the kidnapping and murder of two people in Niger, said the court spokesman, who by custom is not identified.
The judge also found that the day after the Boston Marathon bombings, the suspect was on the Internet saying, "What you feel now is what the children of Afghanistan, Burma and Iraq feel," the spokesman said.
Outside the court, the suspect's father, Kaddour Mediouni, told CNN his son is innocent and would not hurt anyone, and had no links to terrorists nor to the other suspect.
The judge also set preliminary charges against the second suspect, Hassan El Jaaouani, 52, of Morocco, who was arrested Tuesday in Murcia, Spain. But he was released from jail because the judge did not see such a strong link to terrorists in his, the spokesman said.
But the judge ordered El Jaaouani to surrender his passport and report twice a month to authorities, the spokesman said.
Spanish police said after Tuesday's arrests that there was no indication of an imminent attack.
Police see a similar 'profile'
The two suspects have a "profile" that is similar to the two suspects in the Boston Marathon attacks, an Interior Ministry 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 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.
Both of the suspects are unemployed, the second Interior Ministry spokesman said. Mediouni studied computer sciences but had not worked professionally in that field, the ministry statement said.
The two men had 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 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 arrests in Spain came 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.