| Last updated
The ball - hit low from a fair distance out - reached Wojciech Szczesny in goal, but the former Arsenal keeper couldn't keep the ball out, as he palmed it into the net.
That made an action-packed game 2-2 on the night; 4-3 to Porto on aggregate. Juventus pulled one back through Adrien Rabiot, but the last-16 tie finished 4-4 overall and Porto went through on away goals.
Ronaldo and Szczesny will inevitably face criticism for their role in the crucial free-kick which changed the game.
Juventus and Ronaldo - the record Champions League goalscorer - exited the competition. The Serie A champions have never got past the quarter-final stage since the Portuguese ace joined the club in 2018.
Porto actually got off to a perfect start with Oliveira's first-half penalty putting the visitors 1-0 up on the night and 3-1 up on aggregate.
However Juventus got their act together in the second half as the man who scored their goal in the first leg - Federico Chiesa - curled in a superb shot to equalise on the night.
A second booking for Porto's Mehdi Taremi followed a few minutes later - for kicking the ball away of all things - and his side were down to 10 men as the striker trudged off.
Then that man Chiesa struck again, this time meeting Juan Cuadrado's cross with a powerful header to level the tie overall at 3-3.
Former Chelsea winger Cuadrado was the inspiration for Juve's second-half fightback - and he almost won the game for the Italian side when his injury-time shot struck the underside of the bar but came back out.
That sent the game into extra time, where Moussa Marega had a chance to put Porto ahead with a close-range header but the forward powered it straight at Szczesny.
But Szczesny was at least partially to blame for the goal which put Porto through, as he failed to keep out the long-range free-kick - which went right through Ronaldo in the wall and into the back of the net.
Chosen for YouChosen for You
Most Read StoriesMost Read