Starting on pole for the first time in four years, Jack Miller made a brilliant start as he led from Bastianini and team-mate Francesco Bagnaia.
Further back there was a big crash at turn one as Brad Binder clipped a slow-starting Johann Zarco which resulted in the Pramac rider crashing into Michele Pirro and Pol Espargaro, who were both positioned on his outside.
There was further drama at the beginning of lap two as race leader Miller crashed at turn four.
A disastrous start for Ducati then got worse as Marco Bezzecchi crashed on the same lap at turn 10.
With the hot temperatures proving to be difficult to overcome, Franco Morbidelli and Fabio Di Giannantonio both crashed on lap three.
At the front, Bastianini led following Miller’s crash but the Gresini rider nearly lost the front-end at turn 14, instead producing a brilliant save.
Still in the lead, Bastianini was soon relegated to second as Bagnaia came through at turn eight.
The future factory Lenovo Ducati rider was then bumped down to third as Maverick Vinales made a very brave move for P2 on lap four.
In fifth and sixth, Espargaro made a mistake trying to close in on the top four of Bagnaia, Vinales, Bastianini and Luca Marini, which gifted the place to Quartararo.
As Vinales began lining up a move on Bagnaia for the lead, Quartararo started to slowly bring himself into the front group.
Following his early mistake at turn 13, Espargaro was struggling to keep pace with Quartararo, who for the time being also saw his charge towards Marini halted.
Doing everything possible to close in on Marini, Quartararo was instead losing time before receiving a track limit warning. Also on a track limit warning was Vinales who continued to pressure Bagnaia for the lead.
As Bagnaia and Vinales ramped up the pace, Bastianini made a mistake at turn ten which allowed Marini through.
However, Bastianini responded immediately in order to regain third heading into ‘Curvone’ [turn 11].
Despite losing five tenths, Bastianini set a time faster than Miller’s pole time in order to claw his way back on the rear of Vinales’ Aprilia.
With a move for the lead so often appearing to be close, Vinales was instead attacked from behind as Bastianini took second spot away from the Spaniard [turn one] with eight laps to go.
With Vinales seemingly having no response for Bastianini, the Gresini rider started catching Bagnaia very quickly.
With Bagnaia quicker in sectors three and four, opportunities for Bastianini to make an overtake were proving to be at a premium.
And although he made a mistake at turn four to begin the final lap, stunning pace from Bastianini – set the fastest lap of the race on the final lap – saw him set up a move coming out of the final corner, however, Bagnaia held on by just 0.034s over the line.