Luis Salom's RW Racing Kalex KTM stormed into an early lead and looked in control on the damp track, but the pack battled back and he ended up in a race-long battle with Maverick Vinales.
Vinales was cautious in the wet and brought the Blusens Avintia FTR Honda home in eighth - not enough to stop tenth place Salom finishing second in the final championship standings.
Nicklas Ajo finished between the pair in ninth for the TT Motion events team.
Wild-card riders Philip Oettl (HP Kalex KTM Moto) and Juan Fransisco Guevara (Wild Wolf BST) both had points finishes in 11th and 12th respectively.
The battle for rookie of the year played out further down the order with Alex Rins taking the honours on the Estrella Gallicia finishing 16th while Team Italia FMI's Romano Fenati was 18th.
There was drama before the race got started when pole-sitter Jonas Folger had electrical issues with his Mapfre Aspar bike on the sighting lap, eventually starting from pit lane only for his bike to fail again with 17 laps remaining.
John McPhee slid out at the Nieto corner from 13th on the Caretta Technology KRP Honda, Danny Webb also failed to finish for Mahindra.
Alex Marquez, recently crowned Spanish Moto3 champion, crashed out shortly after taking the lead for Ambrogio Next racing.
Efren Vazquez took out his future team-mate at Mahindra, Miguel Oliveira with eight laps to go, while the pair were holding second and third.