Leader Francesco Bagnaia crashed out of the Emilia Romagna and Rimini's Coast Grand Prix as Maverick Vinales claimed a dramatic triumph.
Bagnaia – denied a maiden MotoGP pole and another Misano lap record in qualifying for exceeding track limits – looked set to clinch his maiden success as Sunday's grand prix entered its final stages.
Yet there was to be heartbreak for the Italian, who held over a 1.2-second advantage when he skidded off the track with seven laps remaining.
Vinales, who had started on pole for the second successive race after missing a golden opportunity in the first of the back-to-back Misano rounds last time out, took full advantage to claim his first win of the season and propel himself up the championship standings.
Behind the Monster Energy Yamaha rider, Joan Mir (Suzuki Ecstar) climbed from 11th to see off Fabio Quartararo (Petronas Yamaha) and Pol Espargaro (Red Bull KTM Tech3) to finish second.
Quartaro crossed the line in third, but a long-lap penalty cost the Frenchman top spot in the championship standings, who was handed a three-second post-race punishment, with Espargaro taking the final spot on the podium.
Last weekend's winner and Quartararo's fellow Petronas Yamaha rider Franco Morbidelli came in ninth, one place behind championship leader Andrea Dovizioso (Ducati), who now only holds a one-point advantage over Quartararo and Vinales.
Home star Valentino Rossi was forced to retire after an early crash, while Jack Miller's race was ended by technical problems and Brad Binder also dropped out in a frantic grand prix.
1. Maverick Vinales (Monster Energy Yamaha)
2. Joan Mir (Suzuki Ecstar) +2.425s
3. Pol Espargaro (Red Bull KTM Factory Racing) +4.528
4. Fabio Quartararo (Petronas Yamaha) +6.419 (after three-second penalty)
5. Miguel Oliveira (Red Bull KTM Factory Racing) +7.368s
6. Takaaki Nakagami (LCR Honda Idemitsu) +11.139s
7. Alex Marquez (Repsol Honda) +11.929s
8. Andrea Dovizioso (Ducati) +13.113s
9. Franco Morbidelli (Petronas Yamaha) +15.880s
10. Danilo Petrucci (Ducati) +17.682s
1. Andrea Dovizioso (Ducati) 84
2. Fabio Quartararo (Petronas Yamaha) 83
3. Maverick Vinales (Monster Energy Yamaha) 83
4. Joan Mir (Suzuki Ecstar) 80
5. Franco Morbidelli (Petronas Yamaha) 64
1. Petronas Yamaha 147
2. Monster Energy Yamaha 141
3. Suzuki Ecstar 124
4. Ducati 115
5. Red Bull KTM Factory Racing 110
After successive races at Misano, the teams will head for Barcelona, with the Grand Prix of Catalonia next up.