Juventus picked up a 3-2 victory over Porto after extra-time but that was not enough for them to secure progression to the quarterfinals of the UEFA Champions League.
The Serie A champions came into this clash on the back of a morale-boosting 3-1 win over Lazio in the league and this would have put them in a buoyant mood for the clash with Porto.
The visitors held a 2-1 advantage heading into the return leg and would also have been in high spirits following their 2-0 win over Gil Vicente in the Primeira Liga last weekend.
Juventus manager Andrea Pirlo made six changes to the side that lost in Portugal, with Alvaro Morata, Leonardo Bonucci, Merih Demiral and Aaron Ramsey all among those to be introduced to the starting lineup.
The hosts had the first chance of the game as early as the 3rd minute when Juan Cuadrado put in a delightful cross into the area. Morata made an excellent connection with the cross but his header was directed straight at Agustin Marchesin.
This sprung Porto into action and they fashioned the next best chance soon after. Nigeria international Zaidu Sanusi showed great strength to evade the challenge of Cuadrado before sending a square ball into the area.
Mehdi Taremi was odds on to score in front of goal, but Wojciech Szczęsny pulled off a stunning save at point-blank range to deny him. The Porto attacker followed up with a rebound that smashed the crossbar.
The visitors continued to ask all the questions in the opening stages as a shell-shocked Juventus struggled to clear their lines. They got the chance to open the scoring when Merih Demiral was booked for a challenge on Taremi in the area.
The contact looked minimal but referee Bjorn Kuipers was uninterested in the protests by the Juventus players and the VAR went with the match official's decision.
Sergio Oliveira stepped up to take the ensuing spot-kick and he made no mistake from 12 yards, sending Szczęsny the wrong way.
Juventus continued to dominate possession for the rest of the first half but could not make their pressure count, with Alvaro Morata in particular guilty of missing some gilt-edged chances.
The second half started in the best possible fashion for the hosts when Federico Chiesa found the back of the net after Cristiano Ronaldo had shown his ingenuity to set him up.
There was a brief check for possible offside by the Portugal international but the review showed nothing was wrong in the buildup.
The goal gave Juventus an added spring in their steps. Their cause was aided massively when Porto were reduced to 10 men after Taremi was shown his marching orders for two bookable offenses.
The Turin giants hit the post soon after through Chiesa and from then on, it was one-way traffic as the Italian giants began to ask all the questions.
They soon gained a deserved lead when Chiesa rose highest to meet Cuadrado's cross to put the hosts 2-1 up in the 63rd minute.
Juventus continued to mount the pressure in the final stages and Andrea Pirlo made some changes with 15 minutes to go as they sought a third goal to settle the tie.
The impressive Pepe belied the fact that he turned 38 in February and produced an immaculate display at the heart of defense to thwart the Juventus attackers on several occasions.
The home side put the ball in the back of the net in the first minute of injury time but the goal was disallowed for offside on Alvaro Morata.
This meant that the tie would be decided by extra-time and after a goalless first 15 minutes, Porto went ahead through an ingenious Sergio Oliveira free-kick.
The Portugal international sent his shot beneath the jumping wall and Szczęsny was only able to parry it into the net to draw the game level in the 116th minute.
This gave the visitors an extra away goal and left Juventus needing two goals in less than four minutes to save their Champions League campaign.
There was an instant response from the hosts, as Adrien Rabiot rose highest to head home a corner kick by Federico Bernadeschi but it was a case of too little too late for the Serie A giants.
The result means that Poto have secured their spot in the last eight, while Juventus only have domestic competition to focus on.
Here are five talking points from the fixture.
#5 Porto lose the battle but win the war
Porto put in a comprehensive performance to pick up a 2-1 victory in the first leg on home soil.
It was more of the same in the second leg and two crucial away goals saw them secure their spot in the quarterfinals.
Their 2-1 defeat in regular time ensured that they forced an extra 30 minutes, which gave them more drive to score another away goal.
Visiting manager Sergio Conceicao deserves immense praise for his on-point tactics in Turin.
He set up his side to attack their more accomplished opponents from the first whistle when several other managers would have asked their players to sit back and try to protect their lead.
This progressive approach saw Porto put Juventus on the backfoot in the early stages of the game and it was not entirely surprising that they went ahead inside the opening 20 minutes.
With an away goal secured, his side showed grit and determination to withstand a barrage of pressure from the hosts despite being a man down for most of the second half.
Having pulled through in regular time unscathed, they once again deployed a front-foot approach in extra-time and got a just reward through Oliveira in the 116th minute.
#4 Familar ghosts from the recent past come back to haunt Juventus
This is the third consecutive season that Juventus have been eliminated by seemingly inferior opposition in the UEFA Champions League.
Three seasons ago, they showed great determination to come back from a two-goal deficit and eliminate a compact Atletico Madrid, only for a youthful and vibrant Ajax to stun them in the quarterfinals.
Last term was more of the same, as an unfancied Lyon knocked them out at the round-of-16 stage.
Juventus were expected to learn from past mistakes but that proved not to be the case. They were once again punished for profligacy in attack and porousness in defense.
This elimination means that one of the most talented squads in Europe has once again flattered to decive and questions will begin to be asked about Andrea Pirlo's future as Juventus manager.
#3 Impressive Sergio Oliveira helps Porto put Juventus to the sword
Sergio Oliveira came to the fore against Juventus and his brace in Turin proved to be the catalyst to fire Porto to glory.
The first of his goals came from the spot when he sent Wojciech Szczęsny the wrong way 20 minutes into the first half. The 28-year-old needed to show his physicality soon after that, with Porto having been put on the backfoot as Juventus mounted the pressure.
However, the Portugal international midfielder is an exceedingly gifted and technical player and his abilities were once again on display in extra-time.
With Porto having won a free-kick after Oliveira himself was fouled by Weston McKennie, he dusted himself up to take the ensuing set-piece and showed great ingenuity to find the back of the net from 22 yards out.
The Juventus wall expectedly jumped up to provide extra height but Oliveira slotted the ball beneath them and beyond the despairing dive of Szczęsny.
Ultimately, Oliveira's goals proved to be the difference between qualification and elimination for Porto and the Dragons would be pleased that their number 27 was able to step up and be counted when it mattered most.
#2 By contrast, Federico Chiesa's heroics count for nothing
Like Sergio Oliveira, Federico Chiesa also scored a brace but unlike the Porto man, the Italy international's efforts proved to be in vain.
Chiesa has been in fine form in recent weeks and had provided two assists and scored one goal in his last three Serie A matches, while also scoring the crucial away goal in Portugal that gave Juventus hope in this tie.
The former Fiorentina man had been one of the brightest sparks for Juventus in the first half and deservedly got on the scoresheet at the start of the second 45 minutes.
His goals in regular time saw Juventus come back from a goal down to force extra-time, while he also hit the post in what was an all-round brilliant performance.
In total, the Italy international had four shots, with three of them hitting the target, but it all proved to be a futile effort as Juventus still got eliminated on home soil.
#1 What next for the Cristiano Ronaldo Project at Juventus?
Juventus are one of Europe's great football clubs but the Old Lady of Turin are without Champions League glory since 1997.
This is an extremely long wait for footballing royalty like the Bianconeri and despite having a near total dominance of Serie A, their domestic achievements have a major asterik by virtue of their failings on the continent.
It was for this reason that they sanctioned the purchase of Cristiano Ronaldo from Real Madrid for a club-record fee despite his advancing age.
The Portuguese had shown a penchant for performing on the biggest stages and this came to the fore in his debut season in Turin when he almost single-handedly eliminated Atletico Madrid.
However, things have gone downhill since then and despite consecutive Serie A triumphs, Juventus are yet to make a genuine challenge for the Champions League three years after Ronaldo's arrival.
In the two previous seasons, a case could be made that the Portugal international played his role but was let down by underperforming teammates. However, it was a different scenario in both legs against Porto this season.
Having drawn a blank in his country, the former Manchester United man was once again anonymous in the return leg, although he did show his ingenuity to set Chiesa up for the equalizing goal.
Beyond his assist, it was a sub-par performance from Ronaldo, especially considering what was at stake for Juventus.
His manager had opined that his exclusion from the game against Lazio on Saturday was because he had some fitness concerns, although he went to great lengths to explain that his talisman was in prime condition for the visit of Porto.
But that proved to not be the case and the Juventus number 7 failed to make a genuine mark on the tie which went against his antecedents in previous seasons.
Considering that Ronaldo turned 36 in February, it is safe to suggest that his best years are now very much behind him. He continues to set the pace in Serie A but this is a moot point when you consider that Juventus had won the Scudetto for seven consecutive seasons before his arrival.
It was for his UEFA Champions League prowess that he was signed and the club are yet to make it to the semi-finals three years after his arrival.
With Cristiano Ronaldo's contract set to enter its final year at the start of next season, Juventus will find themselves at a crossroads over the next step to take, especially considering that the major objective for signing the five-time Ballon d'Or winner has not been achieved.