The race was Casey Stoner's last before his retirement from the sport, and he finished it on the podium in third position.
Marc Márquez won the Moto2 race, despite starting from 33rd on the grid, although he had moved up to 13th within the first three corners.
Polesitter Pol Espargaró secured second in the championship behind Márquez by finishing in eighth.
Danny Kent took his second victory of the Moto3 season in front of champion Sandro Cortese and Zulfahmi Khairuddin to complete an all KTM podium.
Dani Pedrosa, who made the pole position in MotoGP, started the race from the pit lane because he entered to the boxes for a bike change because the tarmac was drying, like Alvaro Bautista, Nicky Hayden and Cal Crutchlow.