Muslim leaders in Spain called for calm ahead of Tuesday's crunch World Cup decider between Spain and Morocco amid fears of a repeat of crowd trouble in Belgium last week.
Photographs and videos showed cars being smashed and upturned, and fires started in Brussels in the wake of Belgium’s shock 2-0 defeat to Morocco in Qatar.
The riot police fired water cannons and tear gas to disperse crowds and subway and tram traffic was halted.
Police reinforcements have been increased in Madrid and other parts of Spain ahead of the match in case of trouble.
There is concern that far-right groups like Vox, which is the third largest political force with 52 lawmakers in parliament, may stir up trouble.
Violence among Moroccans living in Spain is extremely rare but the two countries are near neighbours and political tensions have existed in the past over issues like illegal immigration.
Rabat still claims Melilla and Ceuta, the Spanish enclaves in North Africa, as Moroccan territories.
More than 870,000 Moroccan nationals live in Spain, making them the largest group of foreign nationals followed by Romanians and Britons, according to government figures. Many more descendants of Moroccans have become naturalised Spaniards.
There are large communities of Moroccans in the northeastern region of Catalonia, Murcia in the southeast and Almeria in the deep south.
Ahmed, who comes from a Moroccan family but who grew up in Madrid, said he was angry that Moroccans were suspected of being troublemakers.
"It makes me fed up that there are people who can cause these riots and who blame Moroccans. If you are in a country looking for a better life, do not tarnish the image of the rest," he told El Mundo newspaper.
Abdallah Mhanna, the Imam in the AlmuhseneenRead more on euronews.com