Achraf Hakimi struck the decisive penalty in a shootout to send Morocco into the World Cup quarter-finals for the first time on Tuesday (Dec 6) as the African side stunned Spain after a goalless draw.

Spain coach Luis Enrique had claimed he set his players the "homework" of taking 1,000 penalties each.

But Pablo Sarabia, Carlos Soler and Sergio Busquets all missed from the spot before Madrid-born Hakimi dinked his home as Morocco won the shootout 3-0, to the delight of their raucous support.

Walid Regragui's side will face Portugal in what is uncharted territory for them - their previous best run at a World Cup was a last-16 exit in 1986.

Spain had been hoping they could repeat their 2010 World Cup triumph after reaching the semi-finals of Euro 2020, where they were also beaten on penalties by Italy.

Sevilla goalkeeper Yassine Bounou had other ideas and saved brilliantly from Soler and Busquets, while Sarabia hit the post from the spot.

"The penalties cost us but I am proud of my team," said Luis Enrique.

"I take all the responsibility because I chose the first three takers and the players decided the rest - we didn't get to the fourth.

"Bounou is a great goalkeeper when it comes to penalties and today he was superb."

The teams were closely matched throughout a tense game, with Spain having more of the ball but Morocco creating the better openings, few though they were.

Luis Enrique trialled his third right-back of the tournament in Marcos Llorente, and benched the team's top scorer Alvaro Morata for Marco Asensio, after the shock defeat by Japan.

Spain monopolised the ball, with Morocco's fans furiously whistling when their side were out of possession.

Morocco, who are the last African and Arab side left standing at the first World Cup held in an Arab country, were intensely backed and their fans greatly outnumbered Spain's.

With La Roja playing in a pale blue second strip, they resembled the away team on hostile territory.

Gavi, who at 18 years and 123 days old became the youngest player to start a World Cup knockout game since Brazil great Pele in 1958, rose to the occasion.

Regragui's side sat deep defensively, frustrating Spain, and threatened on the counter themselves, with Unai Simon beating away a long range effort from Noussair Mazraoui.