Cristiano Ronaldo scored the first World Cupknockout-stage goal of his career, Goncalo Ramos netted a stoppage-time header and Portugal got a last-second break on an offside call to beat Croatia 2-1 on Thursday and set up a last-16 clash with Spain.
Croatia looked to have equalised at the end, leaving Ronaldo crestfallen on the bench, but the last-gasp effort was ruled offside after a video assistant referee review, prompting the team's supporters in the south end of Toronto Stadium to shower the pitch with debris.
"It’s difficult because it's a game if you don't win, you go home," said Ramos. "But for me, especially, I love those types of moments, I love those type of games, I want to play every game like that, I want to be in the big moment."
It was Josko Gvardiol who thought he had equalised for Croatia in the 103rd minute but a review showed the ball had touched Igor Matanovic on the way through, which made Gvardiol offside.
Ronaldo, 41, became the oldest player to score in the knockout stage of a World Cup when he fired home from the spot to draw Portugal level in the 68th minute of a pulsating game before substitute Ramos rose above the Croatia defenders in the fourth minute of stoppage time.
The goal for Ronaldo, who was taken out of the game by coach Roberto Martinez in the 81st minute, was his first in a World Cup knockout game.
Ivan Perisic had put Croatia in front when he brought down a pass from Josip Stanisic and coolly fired home at the far post in the 53rd minute as the game opened up considerably with incredible back-and-forth action.
PORTUGAL DOMINATE FIRST HALF
Portugal dominated possession in the first half but struggled to convert their chances on a night when a breeze off Lake Ontario offered reprieve from the sweltering heat that blanketed the city for much of the day.
Ronaldo, booed heavily by Croatia supporters every time he touched the ball, failed to get his head on an early Pedro Neto cross and then he and Bruno Fernandes were unable to take advantage of a deep cross from Joao Cancelo.
Croatia, World Cup runners-up in 2018 and third in 2022, came roaring out of the restart and had Portugal on the back foot as Mateo Kovacic picked up a loose ball and went through the defenders but his shot hit the side of the net not long before they opened the scoring.
Nikola Vlasic thought he had Croatia's second but was ruled offside after poking the ball in before Portugal stormed back down the field where Rafael Leao drilled a shot from outside the area that slammed off the crossbar.
Ronaldo nearly scored when he coolly flicked the ball over the goalkeeper Dominik Livakovic and into the net but was ruled offside.
The Portugal captain finally got his moment in the 68th minute when he fired a penalty straight down the middle of the goal after Renato Veiga was pulled down in the area by Vlasic.
EMOTIONAL RONALDO PUTS ON JOTA SHIRT AFTER THE MATCH
Portugal took to the pitch with heavy hearts as the match was played a day before the one-year anniversary of the death of their forward Diogo Jota in a car crash.
An image of Jota in his No. 21 shirt was shown on video boards at Toronto Stadium after the playing of Portugal's national anthem. Portuguese supporters then gave a standing ovation in honour of Jota in the 21st minute.
After the game an emotional Ronaldo put on Jota's red No. 21 shirt while fighting back tears.
"We won for us, Diogo and Portugal. Let’s Go," Ronaldo posted on his official Instagram account.
The last Toronto-based game of the global showcase was a marquee all-European clash featuring two ageless wonders going head-to-head and it was Ronaldo who kept his hopes for an elusive World Cup alive while Luka Modric was left to ponder his international future.
Portugal and Croatia have massive diaspora populations in the Greater Toronto Area and thousands of their supporters braved stifling heat as they danced their way to the stadium for the highly anticipated first World Cup meeting between the two nations.
By the time the game kicked off, the temperature had dropped considerably from the day's earlier high of 37 degrees Celsius (98.6 degrees Fahrenheit) that convinced officials to cancel a watch party outside Toronto City Hall.
Portugal will face Spain on Monday in Dallas with the winner moving on to play Belgium or the United States in the quarter-final.

Anisimova and Fritz through as Americans sparkle at Wimbledon
Spain outclass Austria 3-0 to ease into World Cup last 16
Swiatek, Zverev power into Wimbledon round three
Man City sign Anderson from Forest in record transfer
Fritz and De Minaur ease into Wimbledon third round