Ronaldo escaped red with an elbow off the ball incident and were in disarray in the 90th minute when Cedric was deemed to have hand-balled in the box.
The five-time Balon d'Or victor missed a penalty in the second half, which would have put his side 2-0 up and ultimately won them the game.
Iramatov reversed the call, pointing to the center circle to signal goal, and Spain got the 2-2 draw.
Firstly the VAR officials were wrong in referring it to the referee who inexplicably awarded a spot-kick.
Man of the match Quaresma praised his side's determination and said he was eager for the mouth-watering prospect of a last 16 encounter with twice World Cup winners Uruguay. "The best players in the world face that when there isn't an opportunity to really make it happen", said Portugal boss Fernando Santos.
The result, combined with Spain's 2-2 draw with Morocco and an earlier win for Uruguay over hosts Russian Federation in Group A, means Portugal will play Uruguay in Sochi on June 30, while Group B winners Spain will face Russian Federation in Moscow on July 1.
This came not long after Caceres had reviewed, for several minutes, the foul that Ronaldo committed.
Iran coach Carlos Queiroz was incensed after a decision that followed a video review not to send off Cristiano Ronaldo.
"I need to know if I am grandfather or no. Give me a break", he said. An elbow is a red card in the rules.
Nonetheless, the pundit says that Ronaldo, openly motivated by personal records, will be particularly upset at missing out on a chance to go level with Harry Kane, who has scored five goals at Russian Federation 2018 in just two games.
"But last night, I don't know who was behind the screens and helping the referee but they didn't do a good job". Once replay is introduced, there will be fiddles and fixes, parameters changed and new guidelines introduced, all in the hopes of eliminating the mistakes people make with a system run by people.