The Moroccans held on after an additional 30 minutes of extra time to take a tired Spanish outfit to penalties.
Paris Saint-Germain defender Achraf Hakimi stepped up to take the deciding penalty. Born in Madrid, Hakimi chose to represent Morocco despite being at the Real Madrid academy.
With history on the line, Hakimi showed he was big enough for the occasion and shocked Spanish goalkeeper Unai Simon with the coolest of Panenkas.
More to follow
Achraf Hakimi, panenka to win the game! Incredible Hakimi, incredible Morocco, incredible atmosphere!! pic.twitter.com/PjtUVOkVgs
— Julien Laurens (@LaurensJulien) December 6, 2022
🇲🇦 🇲🇦 🇲🇦 🇲🇦 🇲🇦
⚠️ #Morocco are into the quarter finals of the #FIFAWorldCup ⚠️
These fans didn’t get tickets so 📱 at the ready
🎥 @isaac_fanin pic.twitter.com/4PGRbC6ReS
— BBC World Service Sport (@BBCWSSport) December 6, 2022
Photo: Twitter/@ZachLowy