Cristiano Ronaldo was left in tears after he missed a penalty in extra time, but he managed to convert in a shootout that was dominated by the heroics of Diogo Costa.
Here, Sports Mole takes a look at how each player performed during the last-16 tie, which has set up a mouthwatering quarter-final clash between Portugal and France.
Portugal player ratings vs. Slovenia: Costa stars as Ronaldo experiences difficult evening
GOALKEEPER
Diogo Costa - 9/10
Costa had just two saves to make in the 120 minutes of action, but he ultimately proved to be the most important player on the pitch. The Porto goalkeeper made a crucial stop in the closing stages before saving from each of Slovenia's three penalties.
DEFENCE
Joao Cancelo - 7/10
Offered a threat going forward and was given the license to drift inside as well as drive down the flanks.
Ruben Dias - 7/10
The Manchester City defender produced a steady performance and did everything he needed to do.
Pepe - 5/10
Is father time catching up? The 41-year-old was far from his dependable self. Had Costa to thank after he made a mistake to allow Sesko to run through on goal.
Nuno Mendes - 7/10
Produced a solid defensive display and offered attacking support to Rafael Leao down the left flank.
MIDFIELD
Bruno Fernandes - 5/10
Underwhelming performance from the Manchester United man. Started in an attacking position but dropped a little deeper following Diogo Jota's introduction. Had minimal impact from either position.
Joao Palhinha - 8/10
The Fulham man demonstrated why he continues to attract interest from Bayern Munich. Made four tackles and won 19 duels. Was unfortunate not to score when his shot hit the woodwork in first-half stoppage time.
Vitinha- 7/10
Proved to be a real livewire and showed a desire to want the ball at every available opportunity. May have felt hard done by to be withdrawn in the 65th minute.
ATTACK
Bernardo Silva - 6/10
Conjured up a delightful cross in the early stages that just evaded Fernandes at the back post. But, he ultimately struggled to have a meaningful impact until he scored the winning penalty.
Rafael Leao - 7/10
Carried a constant threat down the left wing, particularly during the first period in Frankfurt. His skill and pace caused a number of problems before he was withdrawn in the 76th minute.
Cristiano Ronaldo - 3/10
It was a truly forgettable night for the Portuguese legend. Spurned numerous free-kicks and failed to take advantage of a late opportunity in regulation time, before he was denied from the penalty spot. He did at least make amends with his goal in the shootout.
SUBSTITUTES
Diogo Jota - 7/10
Won the penalty which should have been dispatched by Ronaldo. Certainly made a case to start in the quarter-final against France.
Francisco Conceicao - 6/10
Looked bright in patches, but ultimately lacked an end product following a number of promising dribbles.
Nelson Semedo - N/A
Ruben Neves - N/A
Slovenia player ratings vs. Portugal: Oblak and defence earn plaudits
GOALKEEPER
Jan Oblak - 8/10
May have thought he had produced the game-defining moment when he denied Ronaldo from the penalty spot. Made six saves in total during the 120 minutes.
DEFENCE
Zan Karnicnik - 7/10
Struggled at times against the dangerous Leao, but he offered stubborn resistance and played his role in a resolute backline.
Vanja Drkusic - 7/10
Enjoyed a strong display until he gave away the penalty. May have felt hard done by even if it was probably the right call.
Jaka Bijol - 8/10
Superb performance in the heart of defence. Finished the game with three blocks, 10 clearances and four recoveries.
Jure Balkovec - 8/10
Another standout performer in the backline. The left-back was a difficult man to pass, making several important tackles during the contest. However, he would have been disappointed to miss his penalty in the shootout.
MIDFIELD
Petar Stojanovic - 6/10
Unable to affect the game in attacking areas. Still managed to offer a meaningful contribution to Slovenia's defensive work
Adam Gnezda Cerin - 6/10
Experienced a few difficult moments and was dribbled past on five occasions. However, he showed great energy to last the full 120 minutes.
Timi Max Elsnik - 7/10
Impressive display in the middle of the park, particularly without the ball. Won three of his four tackles and made six recoveries.
Jan Mlakar - 6/10
Struggled to get involved in Slovenia's attacking efforts, but like the majority of his teammates, he showed great energy until he was withdrawn in the 74th minute.
ATTACK
Andraz Sporar - 5/10
Was hooked at the same time as Mlakar after touching the ball on just 24 occasions.
Benjamin Sesko - 5/10
The RB Leipzig man had the chance to win it in extra-time, but could not find a way past Costa. That missed opportunity overshadows a dogged performance from the forward.
SUBSTITUTES
Jon Gorenc Stankovic - 7/10
Added valuable energy to the midfield following his introduction.
Zan Celar - 7/10
Came on as part of a double change with Gorenc Stankovic. Played his part in frustrating Portugal.
Benjamin Verbic - 6/10
Had a couple of successful dribbles, but gave the ball away on several occasions and was one of three players to miss a penalty.
Josip Ilicic - 6/10
Only had 15 minutes to make an impact. Probably should have done better with a promising free-kick. Missed the first spot-kick.