Miguel Oliveira held of Lorenzo Baldassarri, Joan Mir and Francesco Bagnaia in a thrilling Moto2 Italian Grand Prix, after early leader Mattia Pasini crashed out.
Marcel Schrotter took the holeshot from second on the grid, but crashed at the Luco corner just seconds later, allowing Alex Marquez into the lead, while poleman Pasini slid to sixth at the start.
Championship leader Bagnaia moved through on Marquez after the Marc VDS rider ran wide at San Donato at the start of lap two, with Oliveira seizing the advantage on the Spaniard after a blistering start from 11th on the grid.
Oliviera took the lead from Bagnaia at the start of the third lap, with Pasini passing his compatriot with a daring move up the inside of Palagio on the same tour.
Pasini moved ahead of Oliveira on lap seven and sat comfortably in the lead for the next handful of laps, but crashed at the first corner with eight tours remaining.
This released Oliveira into the lead again, though the Ajo KTM rider came under attack from Baldassarri on his Pons machine a lap later at the Savelli and Arrabiata corners.
Oliveira held firm, but lost out into the first turn next time around. Oliveira and Baldassarri continued to debate the lead over the remaining laps, while Bagnaia and Mir were able to break away from Marquez and join the battle for the win.
Baldassarri led Oliveira across the line at the start of the final lap, while Mir deposed Bagnaia to fourth on the previous tour.
Oliveira pounced on Baldassarri into Casanova after the Pons rider suffered a near-highside exiting Borgo San Lorenzo.
Coming out of the final corner, Oliveira had enough in hand to get to the chequered flag 0.184 seconds ahead of Baldassarri for his first win of the season, while Mir just held Bagnaia – whose points lead has been cut to 13 – at bay to complete the podium for the second race in succession.
Marquez ended up a distant fifth in the end ahead of Brad Binder, while Luca Marini was shadowed by Andrea Locatelli, Xavi Vierge and Simone Corsi.
Romano Fenati was a factor in that lead group in the early stages, but a technical issue with his Marinelli Snipers Kalex on lap nine forced him to retire.
The Italian joined a lengthy list of 11 non-finishers, which included Sam Lowes, Tetsuta Nagashima and Hector Barbera, with the latter placed under investigation after colliding with Nagashima in the closing stages.