Inter Milan moved above city rivals AC Milan into third place in Serie A, with an exhilarating 3-2 derby victory at San Siro that ended a five-match winning run for Gennaro Gattuso's hosts.
Matias Vecino's goal gave the Nerazzurri a deserved halftime lead before Stefan De Vrij and Lautaro Martinez, with a penalty, struck after the break, while goals from Milan's Tiemoue Bakayoko and Mateo Musacchio kept the Rossoneri in the game.
Inter coach Luciano Spalletti was facing increasing pressure, after his side were knocked out of the Europa League in the last 16 by Eintracht Frankfurt on Friday.
However, he was left delighted as his team stretched their unbeaten Milan derby run to six games, their best spell since 1999 and moved to 53 points, two clear of fourth-placed Milan.
"We need to say well done to Lautaro for the penalty, well done to (Ivan) Perisic for the runs, well done to everyone for all you did. Bravo, bravo to everyone in that dressing room," Spalletti told Italian broadcasters.
"I thought Milan put in a very strong performance and Gennaro Gattuso ought to be proud of his players. When it's this open and exciting, anyone can win or lose. The city of Milan earned this Derby della Madonnina and were rewarded with a wonderful night of football. We both honoured the derby," he added.
Inter went in front within three minutes when Martinez rose at the back post to head Ivan Perisic's cross into the six-yard box, where Vecino was on hand to smash home from close range.
They doubled their lead in the 51st with De Vrij's superb header beyond keeper Gianluigi Donnarumma, but Milan took six minutes to pull a goal back as Bakayoko headed his first goal since joining on loan from Chelsea in the close season.
Milan substitute Sami Castillejo then tripped winger Matteo Politano and Martinez converted the penalty in the 67th.
But Inter were pegged back four minutes later, when Musacchio scored from the rebound after keeper Samir Handanovic parried a goal-bound deflection from teammate Danilo D'Ambrosio.
There was controversy in the final few minutes when Milan substitute Andrea Conti got a straight red card for a tackle on Martinez, only for the referee to downgrade his punishment to a booking after a Video Assistant Referee (VAR) review.
Spalletti was furious and got sent off for his protests, but his side held on thanks to a late goal-line block by D'Ambrosio from Patrick Cutrone's goal-bound effort.