Cristiano Ronaldo scored twice in the last 10 minutes as Juventus came from behind to beat Udinese on a dramatic day at Stadio Friuli.
According to pre-match reports, Pirlo was in danger of the sack if Juventus failed to win at Udinese, and the Old Lady made a nightmarish start, falling behind in just the 10th-minute when Nahuel Molina hammered a low and hard shot past Wojciech Szczesny.
Weston McKennie somehow headed wide from six yards out and Ronaldo nodded over from close range, as Juventus frantically searched for an equaliser.
Dybala grabs point for Juventus with late penalty against Inter
Having watched Inter finally clinch the title earlier on the day to end Juventus' years of dominance, the visitors produced a lacklustre and lazy performance, but they were handed a lifeline when Rodrigo de Paul handled Ronaldo's free-kick to concede a penalty with just seven minutes remaining. The 36-year-old dispatched the spot-kick with conviction.
And in the 89th-minute Ronaldo turned the match completely on its head, nodding in at the back post from Adrien Rabiot's cross, much to the delight of Pirlo who was booked for his wild celebrations on the touchline.
The victory moves Juventus back into third, two points ahead of fifth-placed Napoli with just four games remaining. They host rivals AC Milan next Sunday.
Ronaldo celebrates with his teammates following his dramatic late winner
Image credit: Getty Images
TALKING POINT - Ronaldo revives Juve's Champions League hopes, as Pirlo lives to see another day
The headlines had been written: Pirlo was heading for the exit door after an abject performance on a wet and miserable day in the north-east of Italy. For just over 80 minutes, Juventus were absolutely woeful. Passes went astray as attack after attack collapsed, with Udinese goalkeeper Simone Scuffet barely having to break sweat.
But then up stepped Ronaldo, who, like his team mates, had been having a day to forget. Throughout his remarkable career, he has never shied away in the big moments, and with Juventus' top-four hopes in jeopardy and Pirlo's job on the line, he produced the goods and handed his side a barely deserved victory.
Whether he will be a Juventus player next season remains to be seen, but if the Old Lady are to play in Europe's elite competition in 2021-22, they will have CR7 to thank.
MAN OF THE MATCH - Cristiano Ronaldo (Juventus)
Saved the best for last with a really special six-minute double, keeping his composure to score the penalty and then grabbing the winner - his 27th goal of the campaign - with a poacher's finish.
Udinese: Scuffet 7, Becao 6, Nuytinck 6, Bonifazi 7, Molina 8, De Paul 6, Walace, 7 Arslan 7, Stryger-Larsen 7, Pereyra 7, Okaka 7.. subs: Forestieri 5, Samir N/A, Ouwejan N/A
Juventus: Szczesny 5, Danilo 5, Bonucci 5, De Ligt 5, Alex Sandro 6, Cuadrado 7, Bentancur 5, McKennie 5, Bernardeschi 4, Dybala 5, Ronaldo 8.. subs: Kulusevski 5, Morata 5, Rabiot N/A, Correia N/A.
10' - GOAL! Udinese 1-0 Juventus (Nahuel Molina): Udinese are ahead and this could spell great trouble for Andrea Pirlo! The visitors are caught sleeping as Udinese take a quick free-kick. It's a great strike from the full-back Molina, who hammers it low and hard and although Szczesny gets a hand to it he can't keep it out.
28' - McKennie should score! He's left completely unmarked from the corner delivery, he sees it all the way but somehow heads wide from six yards out. What a chance for Juventus!
82' - Penalty to Juventus! Ronaldo's free-kick strikes the raised arm of De Paul and there can be no argument from Udinese as the referee points to the spot. A lifeline for the visitors!
83' - GOAL! Udinese 1-1 Juventus (Cristiano Ronaldo, pen): An excellent penalty from Ronaldo as he drills it hard and low past Simone Scuffet. How important could this goal be in Juventus' season?!
89' - GOAL! Udinese 1-2 Juventus (Cristiano Ronaldo): Oh my, Ronaldo has surely won it for Juventus to save Pirlo's job! The substitute Rabiot delivers a cross to the back psot and Ronaldo heads it past Scuffet. What a moment for the Old Lady!
- Only Robert Lewandowski (36) has scored more goals than Cristiano Ronaldo (27) in the top-five European Leagues this season.
- Juventus have conceded at least a goal in all their last 10 Serie A games played: the longest streak for the Bianconeri in the competition since April 2010 (19 matches in a row in that case).
Sterling may be denied Real Madrid move as he prepares for exit - Paper Round
Bumbling Bianconeri steal Saint Petersburg showdown late on