It was a Suzuki 1-2 after the start with Alex Rins leading his rookie teammate Joan Mir, but the team’s hopes suffered a swift blow when Rins crashed at Turn 9 on the third lap.
Soon after, Mir made a mistake and Quartararo moved into the lead, with Vinales and Marquez in the top three.
With Vinales running wide, Marquez was up to second and putting constant pressure on Quartararo.
The Frenchman was visibly struggling with his Yamaha, his bike shaking several times on the straights, and Marquez was eventually able to move around him at Turn 6.
But Marquez made a mistake at Turn 1 next time around, allowing Quartararo to retake the lead.
Up until that point, Vinales was all over Marquez but couldn’t make a move, yet the Spaniard finally found a way through soon after the Honda rider’s mistake before the Timmer chicane.
Vinales then took advantage of yet another Quartararo bike shake to take the lead with ease, with the Frenchman soon also dropping behind Marquez and beginning to struggle to keep up with the duo.
A second mistake from Vinales then allowed Marquez take first place but his lead was again short-lived as his rival pulled off an impressive move at the fast T13 right-hander.
Vinales then extended his lead to half a second, which remained the gap between him and Marquez for a few laps.
But with three minutes remaining, Vinales finally took the gap to over a second, and Marquez could not fight back.
Vinales eventually crossed the line by 4.8s, scoring his and Yamaha’s first win since last year’s race at Phillip Island.
Marquez finished second, bagging his seventh podium this year out of eight races, as he extended his championship lead to 44 points over Andrea Dovizioso.
Quartararo in the end dropped 9.7s adrift but still secured the final podium spot, his second top-three finish in a row.
Fourth place was hotly contested between Ducati duo Andrea Dovizioso and Danilo Petrucci as well as Mir, with the former taking the position in the end.
SIC Yamaha’s Franco Morbidelli completed the top five as he was able to pass Petrucci into the Timmer chicane on the final lap.
Mir lost time during the last couple of laps and also dropped behind LCR Honda rider Cal Crutchlow, settling for eighth.
Pramac Ducati’s Jack Miller was ninth, while Andrea Iannone took his first top 10 finish on an Aprilia.
Pol Espargaro was the top KTM in 11th as Johann Zarco, who was running 10th early on, retired in the pits.
Valentino Rossi had a fast crash with Takaaki Nakagami at Turn 8, the Japanese rider visibly hurt after the incident and taken to the medical centre for a check-up, while Karel Abraham also fell at Turn 3.