A disjointed performance from Juventus saw them suffer a harrowing 3-0 defeat to AC Milan on home soil.
Both sides came into the game knowing that anything other than a win would hamper their chances of securing a top-four finish.
AC Milan manager Stefano Pioli made two changes to the side that saw off Benevento last week, with Davide Calabria coming in for Diogo Dalot, while Brahim Diaz was handed a first start since March.
Juventus made four changes to the team that came from behind to defeat Udinese last week.
Given what was at stake, both teams started the game cautiously and neither side managed to string together any cohesion, which was indicative of their struggles in recent weeks.
The lack of confidence among both sets of players was evident and a scrappy first half trudged along with several misplaced passes and heavy touches.
There were a few moments of quality and Juventus had their first real chance when Gianluigi Donnaruma fluffed his lines while coming out to claim a cross. However, Giorgio Chiellini headed narrowly wide when he should have done better.
AC Milan were the slightly better side in the first half and a brilliant team move set Theo Hernandez on his way down the left flank. However, Alex Sandro did well to recover and prevent Zlatan Ibrahimovic from converting Hernandez' cross.
The lack of cohesion in the first half indicated that it would require a moment of genius to break the deadlock and that proved to be the case right on the stroke of halftime.
Wojciech Szczesny made a terrible error when he punched a cross right into the path of Brahiam Diaz. The Real Madrid loanee rewarded his manager's faith with an excellent goal that saw him hold off several Juventus defenders before sending an audacious lob into the top corner.
There was a brief check for a handball in the buildup to the goal but the VAR decided that the goal was valid.
The second half was a more open affair, with Juventus charging forward to get an equalizer but it was AC Milan who got a golden opportunity to score the second goal of the game.
The visitors were awarded a penalty when the referee penalized a handball by Chiellini after consultations with the VAR.
Franck Kessie stepped up to take the ensuing spotkick but Szczesny made amends for his earlier error with a smart save to his left, although Kessie's tamely struck effort did not give him much work to do.
Stefano Pioli was forced into two changes due to injuries to his two forwards. Zlatan Ibrahimovic and Brahim Diaz were unable to continue after suffering muscle problems and were replaced by Ante Rebic and Rade Krunic respectively.
Rebic gave AC Milan a two-goal cushion with a wonder strike from 25 yards in the 78th minute. Fikayo Tomori then made sure of the result four minutes later when he headed home a freekick from Hakan Calhanoglu.
On the overall balance of play, AC Milan were deserved winners, as Juventus were abject and lacked any sort of rhythm for 90 minutes.
The victory was the Rosonerri's first away win against Juventus since 2011 and saw them climb up into third spot, while the Bianconeri dropped out of the top four.
Here are the hits and flops from the highly dramatic game.
Hit: Fikayo Tomori (AC Milan)
The Chelsea loanee was imperious at the back and helped keep the Juventus forwards at bay.
Juventus made up for their lack of penetration through the middle by resorting to crosses but Tomori was on hand to win almost all aerial balls that came into the Milan box.
He also showed his usefulness at the other end to score his first goal for AC Milan and guarantee the three points were returning to the San Siro.
Flop: Federico Chiesa (Juventus)
Federico Chiesa was the difference-maker for Juventus in their reverse fixture victory over AC Milan but the Fiorentina loanee had a game to forget on Sunday evening.
The visitors' sturdy defending got Chiesa frustrated early on and he in turn constantly questioned the referee's decision for most of the game.
The 23-year-old failed to make any genuine impact for Juventus but instead got himself booked in the 53rd minute for what was an unnecessary challenge.
He was substituted for Paulo Dybala in the 77th minute and the expression on his face indicated that he knew he failed to perform up to expectation.
Hit: Brahim Diaz (AC Milan)
Brahim Diaz was the biggest attacking threat for AC Milan against Juventus and his directness put the hosts on the back foot in the 70 minutes he spent on the field.
The 21-year-old showed great technique to open the scoring with practically the last kick of the first half and continued to be a thorn in the flesh of the Juventus defense after the restart.
He also won a penalty after his goal-bound shot deflected off the arm of Chiellini. Diaz's eventful night saw him cautioned for a cynical foul in the 59th minute.
He registered four shots - which was the highest any player attempted in the game - with two of those hitting the target and he also had a passing accuracy of 94.4%.
His time on the field was brought to an end in the 70th minute when he was substituted due to injury.
Flop: Cristiano Ronaldo (Juventus)
Cristiano Ronaldo was Juventus' savior last week, with his late brace against Udinese giving Andrea Pirlo a stay of execution in the Bianconeri hotseat.
However, he failed to step up to the plate in the marquee game against AC Milan and was frustrated for most of the game.
In fairness to him, the Juventus midfield was almost non-existent which in turn left Ronaldo on the peripheries. This saw him drop deep in a bid to influence proceedings but his decision-making in the final third was poor. He also had several misplaced passes that put his teammates under pressure.
The 36-year-old failed to register a single shot on target and had a pass accuracy of just 76.5% in what was arguably his worst performance of the season.
Hit: Ante Rebic (AC Milan)
Ante Rebic started the game on the bench but got his opportunity in the 66th minute when Zlatan Ibrahimovic pulled up with a muscle injury.
The Croatia international wasted little time in making a mark, with his wonder goal giving AC Milan a more comfortable lead against Juventus.
It was his eighth goal of the season and first since he opened the scoring in the 2-1 victory over Genoa in April.
The severity of Ibrahimovic's injury is not yet known but Rebic showed that he can be counted on to lead the line in the Swede's absence.