Juventus' Blaise Matuidi and Gonzalo Higuain celebrate after the match (Reuters)
Serie A leaders Juventus scored twice in the last five minutes to win 3-2 at Inter Milan who had earlier come from behind to lead despite playing with ten men in an extraordinary match on Saturday.
The Turin side were facing an embarrassing defeat which would have left the door open for title rivals Napoli until Juan Cuadrado's shot went in off Milan Skriniar with three minutes left and Gonzalo Higuain headed a winner at a stunned San Siro.
Juve's win took them four points clear of Napoli, who visit Fiorentina on Sunday, and ensured they will finish the weekend top of the table with three matches to play.
Still smarting from last week's home defeat by Napoli which threw open the title race, Juventus got off to a flying start when Douglas Costa collected Cuadrado's crossfield pass and scored from a narrow angle in the 13th minute.
Inter were in more trouble when midfielder Matias Vecino was dismissed five minutes later, the referee initially showing a yellow card for his tackle on Mario Mandzukic before changing to red after consulting the video assistant referee (VAR).
Juventus thought they had scored a second in first-half stoppage time but the goal was revoked for offside after a VAR consultation.
Against all the odds, Inter turned the game around as Mauro Icardi equalised two minutes after halftime and veteran Juventus defender Andrea Barzagli turned Ivan Perisic's low cross into his own net.
Juve were facing a dramatic defeat until Cuadrado's shot from an impossible angle deflected in off Skriniar with three minutes left.
A trademark late Juventus winner was in the air and it materialised when Paulo Dybala floated over a free kick and Higuain powered in a header in the 89th minute.
Roma run riot
Earlier, AS Roma warmed up for their Champions League return against Liverpool by thumping Chievo 4-1 in Serie A on Saturday despite playing the last half hour with ten men and after surviving a missed penalty.
Edin Dzeko scored twice as Roma, who will attempt to overturn a three-goal first leg deficit in Wednesday's semi-final second leg against the Premier League side, ensured they will finish the weekend in third place.
Patrik Schick turned in Radja Nainggolan's pass and Dzeko volleyed in from Aleksandar Kolarov's cross as Roma took a 2-0 halftime lead against the Flying Donkeys.
Chievo were awarded a penalty in the 56th minute when Roma defender Juan Jesus hauled back Roberto Inglese in the penalty area. Jesus was sent off but Inglese saw his spot kick saved by Alisson.
Stephan El Shaarawy added Roma's third with a solo goal and Dzeko completed the rout when he curled home an equally impressive effort from outside the area.
Inglese headed a consolation for Chievo who are only one place and two points clear of the relegation zone.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook atAhramOnlineSports.)