Juventus had chances to win the tie but the game went into extra time and the drama was far from over, as Porto drilled home a free-kick in the 115th minute to spark wild celebrations amongst the players and coaching staff.
Defiant 10-man Porto upset Juventus to reach the Champions League quarterfinals on away goals after a 4-4 aggregate draw despite losing 3-2 to the Italians.
The match on Tuesday in Turin was thrilling clash that went down to the wire.
Sergio Oliveira's low free-kick for Porto's second goal in the extra period went through the legs of Cristiano Ronaldo in the Juve wall and squeezed past goalkeeper Wojciech Szczesny's despairing dive to strike what proved to be the decisive blow.
Porto had dominated the first half and took the lead in the 19th minute with Oliveira's penalty taking them into the break in front as they looked comfortable at the Juventus Stadium.
But with the first attack of the second half Juve's Federico Chiesa, who scored their goal in the 2-1 last-16, first-leg defeat in Portugal, arrowed a strike into the top corner to give his side hope four minutes after the restart.
The game turned further in Juve's favour as Mehdi Taremi needlessly got sent off for picking up a second yellow card in the 54th minute for kicking the ball away, with Chiesa leve lling the scoreline on aggregate with a header in the 63rd.
The hosts had chances to win the tie but the game went to extra time and the drama was far from over as Porto won a free-kick which Oliveira drilled home in the 115th minute to spark wild celebrations amongst the players and coaching staff.
Adrien Rabiot's header three minutes from the end of extra-time for the hosts ensured a grandstand finish in an enthralling encounter, but Porto managed to hold on for a famous victory.
The win was a fitting way to mark the 17th anniversary of the night Jose Mourinho's Porto side knocked Manchester United out in dramatic style en route to winning the Champions League.
"These games are marked in the history of the club," Porto coach Sergio Conceicao said. "The players dignified the fans with the passion they have.
"We suffered but also created difficulties for Juventus. We were a real team. Congratulations to the players, they did a fantastic job. After Taremi's expulsion, we showed the Porto DNA. We never stopped believing."
⏰ RESULTS ⏰— UEFA Champions League (@ChampionsLeague) March 9, 2021
🔵⚪️ Ten-man Porto beat Juventus on away goals via extra-time Sérgio Oliveira goal 💪
⚫️🟡 Erling Haaland double sends Dortmund through to quarter-finals 🎉
🤔 Who impressed you most?#UCL
From the start it was clear Porto were not content to sit on the first-leg lead, with eight shots at goal inside 25 minutes.
They got the chance to deservedly go ahead on the night when Merih Demiral fouled Taremi in the penalty area, with Oliveira converting his third Champions League spot kick of the season.
Porto had more shots in the first half than they had managed in the opening 45 minutes of any Champions League knockout tie away from home since April 2009, but from the first attack of the second half Chiesa pounced to score for Juve.
Then came what looked like the game’s turning point. Already on a yellow card, Taremi booted the ball away after the referee blew for a free-kick to Juventus, earning him a second caution.
When Chiesa's header hit the net from a Juan Cuadrado cross, Andrea Pirlo's side seemed on course to reach the last eight.
But Porto would not lie down, with veteran defender Pepe throwing himself at everything. Ronaldo had a great chance that he uncharacteristically headed wide, before Chiesa was denied by a brilliant save from Porto keeper Agustin Marchesin.
Right at the end of normal time, Cuadrado thought he had won the tie only for his curled strike to hit the crossbar.
A first penalty shootout in the Champions League since the 2016 final loomed, with Porto defending manfully.
But with a rare attack, they won the free-kick that decided the contest.
As many expected, Ronaldo did have a hand in the decisive goal but not as he would have wanted, as the ball passed through his legs as he jumped in the wall, with Szczesny unable to keep Oliveira's low strike out of the Juve goal.
Following Rabiot's headed reply there were plenty of Porto heart-in-mouth moments, penalty appeals waved away and last-ditch blocks but they deservedly got over the line.