A stunning hat-trick from Cristiano Ronaldo fired Portugal into the final of the Nations League with a 3-1 victory over Switzerland in Porto.
A closely fought contest at Estadio do Dragao was settled by the individual brilliance of the host nation's captain, who opened the scoring in the first half before striking twice in two minutes just as extra time looked likely.
Switzerland looked the better team for long spells and deservedly drew level after half-time thanks to Ricardo Rodriguez's penalty, which was awarded in remarkable circumstances after a Portugal spot-kick was overturned by VAR.
But Ronaldo ensured Portugal will contest the final of this inaugural competition against either England or Netherlands on Sunday thanks to two stunning pieces of finishing in the closing moments.
Xherdan Shaqiri and Haris Seferovic each missed presentable openings as Switzerland started the stronger.
They were made to rue those misses 25 minutes in. Ronaldo, having won a free-kick thanks to a robust challenge from Kevin Mbabu, fired the ball past a messy wall and into the bottom-right corner beyond the static Yann Sommer.
Cristiano Ronaldo fires in a free-kick to end his 4-match scoreless streak with Portugal! pic.twitter.com/0pdmHdS6qu— ESPN FC (@ESPNFC) June 5, 2019
There was a further chance for Seferovic, whose half-volley from Mbabu's cross clipped the crossbar, and Joao Felix spurned an opportunity to mark his debut with a goal when Ronaldo played him through.
Switzerland drew level 12 minutes after the restart, though - and in extraordinary fashion.
Portugal were awarded a penalty after Bernardo Silva was clearly fouled by Fabian Schar, but referee Felix Brych overturned the decision and awarded a spot-kick to Switzerland as, earlier in the same passage of play, Nelson Semedo made the slightest of contact with Steven Zuber and tripped him in the box. Rodriguez dispatched the ball from 12 yards despite Rui Patricio's best efforts.
There was a further blow to Portugal when Pepe went off with an arm injury, and Switzerland began to look the most likely to snatch a winner, with Shaqiri causing particular problems and Mbabu setting up chances for Zuber and Renato Steffen.
But Ronaldo came to his side's aid when it mattered most. He struck his second goal with a low first-time finish from a Silva cut-back, and he added a third in the 90th minute, racing into the penalty area, bamboozling Manuel Akanji and rifling past Sommer.
Cristiano Ronaldo AGAIN! He strikes late to give Portugal the lead! pic.twitter.com/zdA6N0EDPx— ESPN FC (@ESPNFC) June 5, 2019
RONALDO MAKES IT THREE!— ESPN FC (@ESPNFC) June 5, 2019
He gets his 7th career hat trick with Portugal! pic.twitter.com/98I4395sdD