Enea Bastianini won a thrilling Moto3 race in Barcelona ahead of Marco Bezzecchi, who extended his championship lead thanks to Jorge Martin crashing from the lead.
Gresini's Martin led off the line and only Tatsuki Suzuki was able to keep up with the local rider as the duo pulled away from a large group fighting for third.
Their lead was up to 2.5s when the chasing group started to catch back up as Bastianini, Aron Canet, Jaume Masia and Bezzecchi stopped fighting for position.
However, Martin soon crashed at Turn 9, and Suzuki, now alone, lost all his advantage, as well as the lead to Bastianini, in a single lap.
An 11-rider fight for the win ensued afterwards, with the lead changing at the end of the main straight on every lap.
The top group shrunk as Ayumu Sasaki crashed and then a massive incident involving Aron Canet, Nicolo Bulega, Albert Arenas occurred at Turn 5. The crash was caused by Arenas tagging Canet, who then collected Bulega.
Two laps later, Jaume Masia hit Andrea Migno while braking into Turn 1, both of them crashing out.
Only five riders remained in the lead group for the final four laps, with John McPhee and Bezzecchi trading first place initially.
However, Bastianini slipstreamed his way into the lead from fourth on the final lap and pulled away just enough to deny a counter attack.
The Leopard rider crossed the finish line first by 0.167s to take his first win since the 2016 Japanese Grand Prix.
Gabriel Rodrigo was up to second on the last lap but ended up losing the position to Bezzecchi by 0.003s coming out of the final corner.
With Martin crashing, Bezzecchi extended his championship lead to 19 points with Fabio Di Giannantonio taking over as his main challenger.
Di Giannantonio had a low-key race, starting only 13th and dropping to last when he ran wide early on.
However, with 11 riders retiring and four more penalised, the Gresini rider recovered to seventh.
McPhee took his best finish of the season in fourth with Suzuki eventually settling for fifth.
Rookie Alonso Lopez (Estrella Galicia 0,0) crossed the line sixth but was given a two-place penalty for an illegal manoeuvre and not respecting track limits, which dropped him behind Kaito Toba (Honda Team Asia) and Di Giannantonio.
Sky VR46's Dennis Foggia and wildcard Angel Nieto's Raul Fernandez completed the top 10.
Darryn Binder crashed on the opening lap with Kazuki Masaki and Marcos Ramirez also retiring.
|7||Fabio Di Giannantonio||Honda||21||38'43.755||6.872|
|17||Lorenzo Dalla Porta||Honda||19||39'11.677||2 laps|
|Jaume Masia||KTM||17||31'14.290||4 laps|
|Andrea Migno||KTM||17||31'14.355||4 laps|
|Aron Canet||Honda||15||27'32.798||6 laps|
|Nicolo Bulega||KTM||15||27'33.068||6 laps|
|Albert Arenas||KTM||15||27'33.506||6 laps|
|Tony Arbolino||Honda||15||28'14.859||6 laps|
|Ayumu Sasaki||Honda||15||28'52.793||6 laps|
|Marcos Ramirez||KTM||14||27'02.901||7 laps|
|Jorge Martin||Honda||8||14'39.927||13 laps|
|Kazuki Masaki||KTM||4||7'26.918||17 laps|