Juventus went into their Champions League last-16 first-leg tie with Porto as the favourites.
But they slumped to a defeat at the Estádio do Dragão.
Porto took the lead after just 61 seconds through Mehdi Terami.
The Porto man capatalised on an error from Rodrigo Bentancur and finished past Wojciech Szczęsny.
The Portuguese side then doubled their lead 20 seconds into the second half through Moussa Marega.
Federico Chiesa pulled one back with just under 10 minutes remaining as he produced a lovely finish from Adrien Rabiot's cross.
Juventus pushed for an equaliser and they thought they should have had a last second penalty.
Cristiano Ronaldo produced a brilliant touch in the box and was taken down by a Porto player.
But, despite his protests, his appeals were waved away. VAR checked the moment and it was deemed not a foul, to Ronaldo's disgust.
Ronaldo made sure to give the referee a piece of his mind at full-time.
You've seen them given, that's for sure.
The moment just capped off a frustrating night for Ronaldo and Juventus, who were second best throughout in Portugal.
That late goal from Chiesa gave them an away goal, though, which could prove vital for the return leg in March.
The tie is far from over and you wouldn't be surprised at all if Ronaldo had a say when the two teams meet again in three weeks' time.