Cristiano Ronaldo saw an extra-time penalty saved by Jan Oblak, but recovered to convert in the shoot-out as Portugal survived a huge scare to beat Slovenia on spot-kicks following a goalless draw in the last 16 at Euro 2024.
Ronaldo had a glorious opportunity to send Portugal through in the first half of extra time, but broke down in tears when his tame kick was repelled by the Atletico Madrid goalkeeper.
He had earlier missed chance after chance in regulation time as Slovenia – chiefly thanks to the efforts of Oblak – kept Roberto Martinez's team at bay to force spot-kicks.
However, he made no mistake with his second attempt from the spot, and Diogo Costa kept out all three Slovenia kicks from Josip Ilicic, Jure Balkovec and Benjamin Verbic.
The Selecao will now take on France for a spot in the semi-finals on Friday, while Slovenia's tournament is over despite a gallant effort in Frankfurt.
Both Ronaldo and Bruno Fernandes were unable to get a touch on Bernardo Silva's inswinging cross as Portugal put Slovenia under pressure early on, the former also heading straight at Oblak when presented with another good chance 31 minutes in.
Oblak was then relieved to see Ronaldo send a dipping free-kick effort narrowly over the crossbar, before Joao Palhinha saw a low drive kiss the outside of the post on the stroke of half-time.
Ronaldo saw another free-kick beaten away by Oblak after the restart, before Benjamin Sesko squandered a huge chance on the break, dragging his shot wide after showing blistering pace to beat Pepe – now the oldest player to play in a World Cup or European Championship knockout match at 41 years and 126 days.
Ronaldo had one final chance to avoid extra time in the 89th minute, but Oblak stood firm to repel his left-footed strike at the near post, and keep Slovenia in the tie.
It was Oblak versus Ronaldo once again as the first half of extra time drew to a close, Daniele Orsato awarding a penalty when Jota was felled by Vanja Drkusic.
Ronaldo went for the bottom-right corner, but Oblak sprung across to make a brilliant stop and leave the five-time Ballon d'Or winner in tears at the interval.
It was then Costa's turn to produce the heroics at the other end, making a huge one-on-one save to deny Sesko following a mistake from Pepe to take the tie to penalties.
Costa was unbeatable in the shoot-out, too, keeping out all three Slovenia kicks, while Ronaldo atoned for his earlier miss by converting coolly with Portugal's first kick, before Fernandes and Bernardo Silva also converted as the Selecao edged through