A suspected Islamist detained last week for allegedly plotting terrorist attacks in Spain and elsewhere in Europe was remanded in custody on Monday, a court official said.
Police detained Mohamed Echaabi, a 22-year-old Moroccan, on Thursday in the eastern city of Valencia.
Spanish authorities said Echaabi had the same profile as Mohamed Merah, a French Algerian who shot dead seven people last year, including three children in a Jewish school in Toulouse.
Judge Javier Gomez Bermudez of the National Audience, Spain's top criminal court, on Monday ordered Echaabi to be held in jail while he carries out his investigation, a court official said.
Echaabi had travelled to Gaza in 2011 and had also tried to buy guns and explosives, police said at the time of his arrest.
"Police consider Echaabi a lone wolf, recruited by terrorist networks and self-radicalised via the Internet," much like the 23-year-old Merah, a police statement said.
"Police surveillance and the activities he carried out revealed his intention to commit terrorist acts against certain people and other targets, in accordance with the doctrine of global jihad, in Spain and other European countries," it added.
Police made no material link between Echaabi and Merah, who was shot dead by police in a siege at his home last March.
Spanish authorities last year said Merah had been to Spain in 2007. He reportedly took part in events at Mosques in the northeastern region of Catalonia.
Several suspected Islamic extremists have been arrested in recent years in Spain, which in 2004 suffered one of Europe's worst extremist attacks.
On March 11, 2004, bombs exploded on packed commuter trains in Madrid, killing 191 people and wounding 1,841 others in attacks linked to the Al-Qaeda network.
Twenty-one people, mostly Moroccans, were convicted of involvement in those attacks.