Morocco are through to the World Cup quarter-finals for the first time after a famous triumph over neighbours Spain, Hakim Ziyech scoring his penalty in the one-sided shoot-out that followed two hours of tense knockout football.

It finished goalless at the Education City Stadium. Both teams had come close to winning it in extra-time in what was a largely even and hard-fought contest, but there was a huge gulf between them when it came to the spot-kicks.

Spain missed all three of theirs, with Ziyech netting one of Morocco’s four attempts, three of which were converted, sparking incredible scenes in the stadium. One of the best-supported teams at this tournament’s story goes on.

Cesar Azpilicueta remained an unused sub for Spain, while Ziyech started on the right of Morocco’s front three as usual. Like Achraf Hakimi he was playing a seventh World Cup game for the Atlas Lions, the outright most of any Moroccan player in history.

In a competitive first half shorn of many clear openings, Morocco’s high tempo made life tricky for Spain whenever they tried to make the most of their possession in the final third.

Marco Asensio had the favourites’ solitary chance of note before the break, hitting the side-netting having been found in space. For Morocco, Hakimi curled a free-kick over, Noussair Mazraoui tested Unai Simon from range, and Nayef Aguerd headed over when he might have done better.

That was from a cross delivered by the lively Sofiane Boufal, and from another soon after, Ziyech headed back into a dangerous area, but again Spain could clear as Morocco finished the half on the front foot.

Ziyech set off on a direct dribble down the right flank when play restarted as Morocco tried to pick up where they left off. They continued to keep Luis Enrique’s side at arm’s length, restricting Spain to one set-piece shot from Dani Olmo as this derby entered the final 10 minutes.

It was a tense finale with both sides trying to find space behind tired defences. Ziyech and Hakimi combined delightfully with the ball eventually falling to sub Walid Cheddira, who couldn’t generate enough power on the spin to trouble Simon.

In stoppage time, a fizzed Ziyech free-kick caused the Spanish backline problems, but an offside flag spared them any major concerns. It was then Morocco’s turn to worry as a set-piece from Olmo called Bono into a diving save, preventing a dramatic winner and sending this last-16 tie to extra-time.

The best chance of the first additional period - indeed probably the best chance of the entire game - fell to Cheddira, who latched on to a through ball but could only shoot at Simon’s legs, much to the despair of the banks of Moroccan fans behind that goal.

Cheddira looked like he might get away again in the second period of extra-time, only for the ball to get caught under his feet.

It was Spain who finished the stronger, pinning Morocco back, and for a second it looked like they had pinched victory with the last kick, Pablo Sarabia’s volley kissing the far post on its way wide. To penalties it went.

Sarabia hit the post as Spain blinked first, and Ziyech cemented that advantage with the next spot-kick, blasting it straight down the middle. 2-0 Morocco, and it got even better when Bono saved Carlos Soler’s penalty.

Simon responded, keeping out the next penalty, but Bono was at it again to thwart Sergio Busquets’ effort, guessing right again. That left Madrid-born Hakimi to calmly panenka the winning penalty and book a quarter-final against either Switzerland or Portugal.

Spain exit at the round of 16 stage for the second World Cup running having again failed to create enough in front of goal, bringing a disappointing end to our skipper's third World Cup experience.