Federico Chiesa scored twice as champions Juventus produced a superb display to end AC Milan’s unbeaten league run this season.
The 23-year-old opened the scoring in the 18th minute when he played a fantastic one-two with Paulo Dybala before drilling home.
Davide Calabria levelled with a great side-foot finish before Chiesa gave Juve the lead again with his low drive.
Weston McKennie made certain of victory with a strike from close range.
Milan remain top of Serie A by a point from city rivals Inter who earlier lost 2-1 at Sampdoria. Juve, who have endured a mixed start to the campaign, are now up to fourth – seven points behind Milan.
Juve have won the past nine championships but hopes of making it 10 have taken a big knock this season after a handful of erratic displays under new coach Andrea Pirlo.
Milan, without their injured talismanic striker Zlatan Ibrahimovic, were favourites to win inside the San Siro but were rocked in the 18th minute when Chiesa struck. The Italian winger began the move on the right and then ran into the area to meet Dybala’s control and flick with a first-time strike.
The Serie A leaders regained control and began to test Wojciech Szczesny, with the Polish goalkeeper pulling off great saves to deny impressive Portuguese attacker Rafael Leao and Hakan Calhanoglu.
They finally beat the last line of defence when Leao sped down the left and picked out David Calabria, who placed his effort high past Szczesny.
The Juve goalkeeper was tested again by full-back Diogo Dalot before Chiesa put Juve back in front with a low strike from the edge of the area.
American midfielder McKennie swept in the third 14 minutes from time after good work from Dejan Kulusevski on the right.