A late penalty earned a draw for Iran against Portugal in a bad-tempered group decider in Saransk that was dominated by VAR decisions and saw Portugal go through to the last 16 despite a tense final few minutes.

Iran’s Portuguese coach, Carlos Queiroz, ranted at Fifa and the VAR system afterwards, suggesting Cristiano Ronaldo should have been sent off for a late elbow on Morteza Pouraliganji. The Paraguayan referee, Enrique Cáceres, reviewed footage of the incident for what seemed like an age before eventually showing a yellow card.

Iran v Portugal: World Cup 2018 – live! Read more

“Elbow is a red card in the rules, the rules doesn’t say if it’s Messi or Ronaldo,” said Queiroz.

VAR featured in two other key moments in the match, with a penalty awarded for each side after video review. Ronaldo’s penalty, early in the second half, was saved, while Iran’s late, controversial penalty was converted with aplomb by Karim Ansarifard. The goal cancelled out Ricardo Quaresma’s opener but was not enough for Iran, serving only to send Portugal into the harder section of the draw and pushing Spain top of the group on goal difference.

The equaliser did lead to a frantic last few minutes, in which Iran pushed for a second goal that would have taken them through. For a brief moment half the stadium thought Iran had found an unlikely winner but Mehdi Taremi’s shot had hit the side-netting; and then it was all over.

The decisive moment of skill in the match came not from Ronaldo but from Quaresma, who just before half-time curled a superb shot with the outside of his boot across the keeper, Alireza Beiranvand, and into the top corner from the corner of the area. Beiranvand, whose diving arm was just shy of the ball, looked sickened, but in reality there was little he could have done to stop the shot.

The first half-hour include many crunching tackles and few clear-cut chances, with the Iranians in particular looking tense due to the importance of the game. This was most visible on the 10-minute mark, after a mix-up between Beiranvand and Saeid Ezatolahi, with the player sliding in to clear just as his goalkeeper was approaching to scoop up the ball. Instead the loose ball fell to João Mário. He shot over but Beiranvand shoved Ezatolahi in the chest and yelled some choice words at him. Soon afterwards Beiranvand spilled what should have been a routine cross and was lucky the ball broke to his own player.

Iran tackled hard and, for the most part in the first half, fairly. Alireza Jahanbakhsh caused Portugal problems down the right on Iran’s occasional forays forward and Raphaël Guerreiro got a booking for bringing him down just outside the box.

The goal, just before half-time, led Iranian heads to droop and briefly quelled the endless din of vuvuzelas inside the stadium, where Iran fans predominated. However, they were buoyed soon after the restart. Ronaldo had a leg clipped by Ezatolahi just inside the penalty area. The referee was having none of it and in a pre-VAR world Ronaldo’s reputation for falling easily would have meant that was the end of the matter.

But the men in the VAR room soon signalled to the referee that he ought to have a look again. On seeing the replay he had no choice but to award Portugal the penalty, the protests of the Iranians leading to nothing but a booking for Ehsan Hajsafi. Beiranvand, who had looked dodgy all night, made amends with a brilliant save, starting off in a position behind his goal-line and bouncing forward.

Facebook Twitter Pinterest Mehdi Taremi’s put a vital stoppage-time chance just wide. Photograph: Mladen Antonov/AFP/Getty Images

The saved penalty drew tremendous cheers from the Iranian fans and spurred the team on to a period of attacking. Saman Ghoddos, on for Jahanbakhsh, who had faded out of the game in the second half, scuffed a low shot just wide of a post but for the most part Portugal were in control and the great roars that accompanied every Iran attack became less frequent.

They resorted to looking for unlikely penalties: three times in the second half Iranian players went down optimistically in the area. Queiroz was warned by the referee for furiously making VAR gestures on the touchline.

The game became more vicious as it went on, with crunching tackles, diving and impassioned harassment of the referee coming from both sides. It seemed Portugal would hold out for the win but there was still drama to come. First was the VAR decision on the red card for Ronaldo. The contact was there but weak and in the end the referee went for a compromise yellow.

Quick guide Dramatic night of VAR in Group B Show Hide 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

Then came Iran’s fourth penalty appeal, for a handball that Cédric Soares knew little about. It hardly looked more promising than the previous three shouts but was referred to VAR and eventually given. The substitute Ansarifard fired a perfect penalty into the top corner but it was already deep into stoppage time. Taremi was off target in the final seconds and, as the whistle went, the Iranians fell to the ground dejected.

Spain held by Morocco but Iago Aspas goal ensures they face Russia Read more