Moroccans gather to celebrate Morocco's win over Spain in a World Cup match played in Qatar, in Rabat, Morocco, Tuesday Dec. 6, 2022. [AP Photo]

The King of Morocco, Mohammed VI, praised the national team and sent his "heartfelt congratulations" to the players, the technical team and administrative personnel, "who gave their all and blazed a trail throughout this great sporting event," according to a statement from the royal palace.

The king said the players represented "hopes and dreams of Moroccans in Morocco, Qatar, and all over the world."

Morocco is the only Arab - and African - nation left in the tournament, the first World Cup held in the Middle East. Its World Cup success has reverberated across the Arab world and among Moroccan and some other immigrant communities in Europe.

 Moroccans gather to celebrate Morocco's win over Spain in a World Cup match played in Qatar, in Rabat, Morocco, Tuesday Dec. 6, 2022. [AP Photo]

Celebrations across Spain, which has some 800,000 Moroccan residents, were mostly peaceful, though Spanish media reported a brief scuffle between Morocco and Spain fans in a bar in the southern city of Huelva. No injuries or arrests were reported.

In Qatar, Moroccan fans clashed briefly with police outside the stadium before the game started.

Ten days ago riots broke out in Belgium and the Netherlands as Morocco fans celebrated beating Belgium in the group stage in Qatar.

In central Paris, cars started honking almost immediately after Morocco's surprise win Tuesday, and crowds of people streamed toward the Champs-Elysees to celebrate. Men and women, in business suits or track suits, from teenage to middle-aged, cheered or raised their hands in victory. Cries of "Allez, allez!" in French rang out, and one woman asked strangers "Who has a Moroccan flag I can borrow?"

Spain fans were crushed by the loss.

"They have been very unlucky in the penalties, but it seems to me that they have also made a mistake in the players who take the penalties," said 64-year-old Dionisio Sanchez, who was among a group of fans who trickled out of bar in Madrid.

"They shot with very little enthusiasm ... little desire to score, but the penalties, it's luck, it's a lottery," he said.