BARCELONA/MADRID (Reuters) - Spain fans were left in tears on Tuesday after the team crashed out of the World Cup on penalties to Morocco, whose fans filled the streets with cheers, flares and flags from Barcelona to Madrid and the enclave of Melilla.
People had packed into bars decked out in the red and yellow Spanish flag to watch the team, but it was Morocco supporters who owned the night as their side beat Spain 3-0 on penalties and booked their ticket to the quarter-finals.
Morocco's Achraf Hakimi, who was born in Madrid, netted the decisive spot kick in the shootout.
Spain and Morocco have a long history of rivalry and mutual cultural influences dating back to the Muslim conquest of Iberia in the eighth century and the Spanish Reconquista that followed, with rocky diplomatic relations in the past decades, often upset by migration issues.
Spain fans were dejected to see their team crash out of the tournament.
"We go back to Spain crying and we will have to reflect," said Julia Calvet, 21, in a Barcelona bar.
Prime Minister Pedro Sanchez was quick with a consolation message, tweeting: "You have thrilled us and made us proud."
The Spanish Royal Family tweeted "Nothing ends here...Let's keep moving forward, keep competing and keep fighting."
Some fans were philosophical about the defeat, which came after Spain had dominated possession but failed to crack the tight Moroccan defence.
"They have not disappointed me, because they have played very well, but I'm a bit sad. Against Morocco, a team that is not very strong, we could have won...they have played defending all the time," said Rafael Gomez, 27, who was watching the match in a Barcelona bar wrapped in a Spanish flag.
But it was a very different night for Spain's Moroccan population - the largest foreign community making up 16% of all foreign residents according to official data.
In Barcelona, Morocco fans packed into the central Raval neighbourhood to celebrate, lighting flares and singing.
"We needed to win so that Moroccans have confidence in themselves in Spain," Anass, a 22-year-old Moroccan cook told Reuters in downtown Barcelona. "And we hope to go to the final!"
People took to the streets in Melilla, Spain's north African enclave that borders Morocco, cheering, dancing and honking their horns in celebration, national broadcaster TVE showed.
Spain's police force had deployed extra officers in case of post-match disturbances but most celebrations were peaceful.
Spain retained the enclaves of Melilla and Ceuta, which were previously colonial territories, after Morocco gained independence in 1956.
(Writing and reporting by Jessica Jones; Editing by Toby Davis)