Yassine Bounou saved two penalties for Morocco as they sealed a maiden World Cup quarter-final place following a shootout victory over Spain.
The Atlas Lions held their own against Spain to keep the 2010 world champions at bay for 90 minutes, forcing the game into extra time.
The contest was still not settled after the extra 30 minutes where both teams had glorious opportunities to win before the shootouts ensued. With Abdelhamid Sabiri, Hakim Ziyech and Achraf Hakimi scoring their penalties, Bounou saved from Carlos Soler and Sergio Busquets while Pablo Sarabia hit the post.
Morocco coach Walid Regragui went with a more defensive 4-1-4-1 formation in an effort to contain Spain who dominated position and his charges took on board the instructions, frustrating their opponents for 90 minutes.
The North Africans opted to sit back and soak in the pressure while waiting for their moments to launch counter-attacks and the tactic worked in the first half when they were the better side, managing one shot on target through Noussair Mazraoui, while their opponents had none.
Spain upped the ante after the break in an effort to get back in the game but good defending and the heroics of Bounou kept Morocco in the game.
Morocco will take on either Portugal or Switzerland in the quarter-finals.