Despite having more than 75% of possession and completing almost 800 passes, the Spanish armada in Qatar could not contain the problems posed by a resilient do-or-die Morocco team on the counterattack.
It was on the whole a scrappy match that ended on a deadlock at 0-0 after extra time with few shots on target. Morocco subsequently fed off the raucous support of their red-clad supporters in the shootout as Spain crumbled after PSG star Achraf Hakimi stepped up to calmly convert a penalty to send Morocco through to the World Cup quarterfinals for the first time with a 3-0 shootout win over former champions Spain.
Morocco goalkeeper Yassine Bounou helped save the day for his team nullifying the spotkicks from Carlos Soler and Sergio Busquets after Pablo Sarabia had hit the post. It was then all up to Spanish-born Hakimi who held his nerve to earn his team a quarterfinal against either Portugal or Switzerland.
Morocco became only the fourth African nation to reach the last eight of the tournament, 12 years after Ghana did so in South Africa.
This was the fourth time Spain have been knocked out of the World Cup on penalties and the second, consecutively.