Portugal have reached the World Cup's last-16 after a 2-1 win over Croatia.
The World Cup's round-of-32 continues to deliver late drama after Portugal edged past Croatia to set up another knockout meeting with Spain on 6 July in Arlington.
Cristiano Ronaldo's tournament looked set to go down to the wire when Josko Gvardiol appeared to snatch a late leveller in the 15th minute of added time.
Play our FREE match predictor and win £1kCristiano Ronaldo and Portugal survive World Cup scare
Roberto Martinez's side had endured a few scares during their knockout tie in Toronto after falling behind to Ivan Perisic's opener early in the second half.
Ronaldo himself saw a potential equaliser disallowed for offside before it was immediately ruled out for offside as the omens appeared against his country.
You may like
Portugal vs Croatia prediction as two of Europe's best players go head-to-head
How to watch Portugal vs Croatia for FREE
Is Cristiano Ronaldo retiring after the World Cup?
The five-time Ballon d'Or winner soon made up for that by restoring parity from the penalty spot following Nikola Vlasic's pull on Renato Veiga inside the area.
Although he was later withdrawn, the Selecao completed their comeback deep in second half added time as Goncalo Ramos plundered a 94th minute winner.
The best features, fun and footballing quizzes, straight to your inbox every week.
But there was still one final twist when Gvardiol reacted quickest to steer the ball home from Mario Pasalic's flicked cross as the tie risked entering extra time.
Amid the chaos, Premier League referee Jarred Gillett advised match official Espen Eskas to review the passage of play on the pitch-side VAR monitor.
The Norwegian confirmed that Pasalic had actually received the ball from a slight flick off teammate Igor Matanovic's head which placed him in an offside position.
Incensed Croatia supporters rained down plastic bottles onto the playing surface in protest after the decision had denied their team's World Cup journey a lifeline.
The onslaught led to a minor delay in the game being restarted which would confirm Portugal's place in the last-16 against their Iberian rivals next Monday.
Ronaldo, who was awarded Player of the Match, later shut down media claims by sister Katia Aveiro that he will retire from international football after the World Cup.