Spain held by Morocco but last-gasp Iago Aspas goal ensures they face Russia

In the very last minute of Spain’s last group game, Fernando Hierro and all of Spain’s subs were suddenly off the bench, signalling to their players, a finger raised on each hand. They had done it; or perhaps more accurately, it had been done for them. The selección had just been promoted to first place in Group B from a distance, technology telling them their fate.

They had been 2-1 down to Morocco when Iago Aspas, on as a sub, had scored a late equaliser that took three minutes to be given. When eventually it was, everyone stuck in suspended animation until the video gave its verdict, news came through from the other match in this group. An even later goal from Iran had taken Spain from second place to first – and a very different path to the final.

It had seemed implausible just a moment before. For Portugal, it was painful. For Morocco, it was cruel. They deserved much more at this World Cup and might have deserved more here as well. They could barely believe what had just happened to them. Nor could Spain – but they were as delighted as they were relieved. Hervé Renard had promised that his players would “roar like lions for the pride of Morocco” and were as good as his word, going within minutes and a video review of defeating Spain. In the end, this was a portrait of their tournament. In the end, Spain may just feel that this could be their tournament after all.

Down after 15 minutes, down with just a couple to go, even when they were level, it was not really enough for Spain. What lay before them – Uruguay, perhaps followed by France, and then Brazil or Germany – was daunting indeed. But then, dramatically, it all changed.

Quick guide

Dramatic night of VAR in Group B

Iran penalty appeal

74 min: Sardar Azmoun goes down after a challenge from William Carvalho. Iran wants VAR to get involved but to no avail 

Morocco take the lead

81 min: Youssef En-Nesyri scores with a towering header, beating Sergio Ramos to the ball to connect with Nordin Amrabat’s corner 

Morocco wasting time

81 min: Munir El Kajoui Mohamedi is booked for time wasting with the Spain players increasingly annoyed with their opponents 

Red alert for Ronaldo

88 min: The forward looks worried after an elbow on Morteza Pouraliganji but the referee, after looking at a replay, opts for a yellow  

Spain back on level terms

90+1 min: Iago Aspas scores with a delightful flick. It is first ruled out for offside then, after more VAR involvement, given 

Iran win penalty and score

90+2 min: Over in Saransk, Iran are given a spot kick after VAR decides that Cédric Soares handled the ball. Karim Ansarifard scores. 1-1 

Portugal survive scare

90+5 min: Mehdi Taremi is presented with an excellent chance five minutes in to added on time – but hits the side netting. Portugal survive  

Photograph: Hector Vivas/Getty Images Europe

It has been a long, emotional night, and it had begun with an error when Sergio Ramos played a short pass to Andrés Iniesta near the halfway line. Iniesta’s touch was a little heavy, Ramos waited and Khalid Boutaïb raced way to score, slipping the ball between David de Gea’s legs. Spain trailed, but started to get a grip, inclined to the left where Iniesta and Isco combined and accelerated. Isco rolled the ball under his feet, offering it, hiding it, turning away from challenges. Iniesta sped up but never sprinted; instead, he skated. Every pass had purpose and it wasn’t long before Spain had the equaliser. The ball moved swiftly and through many stations: Iniesta, Isco, Diego Costa, Iniesta, Isco and into the net. Deep into the area, gliding in on the left, Iniesta’s pullback was perfect; Isco lifted the ball high over Munir El Kajoui Mohamedi.

World Cup Fiver: sign up and get our daily football email

But while Spain controlled, they were vulnerable: a simple throw-in had sent Boutaïb racing away again, behind Dani Carvajal and beyond the Spain defence only for De Gea to block him. It was his first save of the World Cup and it was a vitally important one. At 1-1 at half-time Spain were going through, but a goal from Portugal meant that they were doing so in second place. And it would stay that way until the very end.

The opening minutes of the second half suggested they might be grateful from the protection Portugal’s goal afforded them but Spain wanted first place. Gerard Piqué was fortunate not to be penalised for a handball on the edge of the area; De Gea punched a little unconvincingly as M’barek Boussoufa dashed into the area, and then Nordin Amrabat produced an astonishing shot with the outside of his foot that crashed back off the underside of the bar. All that within a 10-minute period during which the speed of Nabil Dirar screeching forward from deep opened them up. Meanwhile, in Saransk, Cristiano Ronaldo missed a penalty that would have made it 2-0.

Spain responded and sped up, urgent now. Even the subs were quick, leaping off the bench to return the ball to teammates when it went off the pitch. The ball was theirs, the pass count climbing beyond 500 within the hour. The opportunities though were fewer than they hoped. The game settled into a pattern: Spain playing, the ball circulated from one side to the other and back again, as Morocco waited ever deeper. Isco’s header from the corner of the six-yard box was cleared off the line by Romain Saïss and from the corner Piqué climbed to nod just wide. Thiago Alcántara bent a shot over after Jordi Alba and Costa combined. Hierro intervened: Marco Asensio and Aspas introduced.

Spain had 15 minutes to claim first place, but they needed two goals. As it turned out, they didn’t have to get them both themselves. Even conceding didn’t ultimately cost them. Fayçal Fajr’s corner was curled in and Youssef En-Nesyri leapt to thump a header into the net. Spain were now not just denied first place, but on edge. Then Aspas appeared. At first his goal was disallowed, but VAR was called and they waited and waited. And waited. By the time the referee signalled for the goal, Iran had scored, too. Spain are through in first place. Morocco roared, but could not stop them.