Reigning world champion Bagnaia looked set to cruise to a first sprint win since the Austrian Grand Prix last year having led by just under a second at the start of lap nine.
But the Ducati rider made a mistake under braking and flew off track at Turn 1, dropping to fourth and releasing Vinales into a slender lead over Pramac’s Jorge Martin.
Martin hounded Vinales over the final few laps, but the Aprilia racer put in a determined ride despite suffering from gastroenteritis to pull a gap to the Pramac Ducati on the last tour.
Vinales got to the chequered flag 1.039s clear of the field to score his first win in Aprilia colours and first since the Qatar GP in 2021 when he was a Yamaha rider.
Marc Marquez scythed past Martin at Turn 5 on the last lap with a hard pass to finish second and score his first podium on the Gresini Ducati.
Bagnaia was fourth after his mistake but still holds a slender two-point lead in the championship.
KTM’s Jack Miller got the holeshot off the line from fifth on the grid as Bagnaia carved his way through from fourth to second by way of an overtake on Vinales at Turn 3.
Poleman Bastianini on the sister factory Ducati dropped to fourth off the line, while Martin slumped to sixth from third on the grid.
Source: Autosport