Lautaro Martinez scored the decisive goal from the penalty spot as Inter beat AC Milan 3-2 in a wild and woolly San Siro derby on Sunday.
Inter held off the hosts' late charge to move clear of their rivals in the Serie A table and bounce back from their midweek Europa League exit to Eintracht Frankfurt.
Defeat ended a run of six straight wins for Milan and could prove costly in their quest to nail down a Champions League berth for next season.
Inter had made a flying start to ease the pressure of their recent poor form, with Martinez heading down an Ivan Perisic cross for Matias Vecino to volley the opener after just three minutes.
But in a hint of the non-stop action that was to come, Milan almost levelled five minutes later when Lucas Paqueta forced a fine save out of Inter keeper Samir Handanovic.
Martinez was denied the chance to extend Inter's lead through a fine saving challenge from Davide Calabria before Paqueta headed just wide for Milan and at the other end Vecino fired just over the bar.
As Inter began to wrest control, defender Milan Skriniar sent a free header over the bar from a corner and Vecino headed another chance too high as Milan were left to cling on to their one goal deficit at half-time.
The seemingly inevitable second goal arrived six minutes into the second half when Stefan De Vrij was left free in the box to send a looping header over Gianluigi Donnarumma.
But Milan responded by reducing the deficit within six minutes, Tiemoue Bakayoko grabbing his first goal for the club with a neat header from Hakan Calhanoglu's floated free-kick.
Donnarumma denied Skriniar but could do nothing about the 67th-minute penalty drilled home by Martinez after Samu Castillejo was adjudged to have tripped Matteo Politano in the box.
To their credit, Milan began to besiege the Inter box as they battled to come back into the match and their persistence paid off in the 71st minute when they once again reduced the arrears.
Mateo Musacchio was on hand to blast home the rebound from close range after Handanovic had initially performed heroics to prevent an own goal from defender Danilo D'Ambrosio.
The goal breathed more life into the Rossoneri with Handanovic having to be alert as he raced from his goal to clear up after a dangerous Calhanoglu through-ball.
Milan then thought they had Andrea Conti sent off for a foul on Martinez only for the decision to be reversed by VAR as tempers began to fray on the bench.
There was still time for Milan to threaten to grab an unlikely point as Handanovic saved well from Castillejo before a last-gap effort from Patrick Cutrone was cleared off the line by D'Ambrosio.