Bagnaia takes victory in Barcelona ahead of Marquez.
But Martin has done all he needed to do, he's finished third in Barcelona to take the 2024 MotoGP World Championship by 10 points over Bagnaia.
Behind, Alex Marquez takes fourth, ahead of Aleix Espargaro in fifth.
Onto the final lap now, and Bagnaia leads Marquez by just over one second. Martin just needs a safe final lap to be World Champion, and Alex Marquez has passed Aleix Espargaro for fourth.
Marquez gets the gap back down to 0.7 with two laps to go. There could be late fireworks yet.
Alex Rins has now been given a double long lap penalty for not taking his first long lap penalty.
Bagnaia responds on lap 21, and his gap is now one second over Marquez. We're down to three laps to go now, and Martin looks nailed on for this title.
Bagnaia coming under threat now. Marquez has closed the gap to half-a-second again. Martin closing in, too, by about 0.2s per lap, but with a two-second gap and only four laps to go he'll run out of time, probably.
Bagnaia maintaining a gap of around 0.8s now over Marquez as we enter the final five laps.
Martin, by the way, remains perfectly secure in third place.
Bagnaia back into the 1:41s, but still a tenth faster than Marquez.
Further back, Acosta has slipped to ninth, and Alex Rins has been given a long lap penalty.
Bagnaia back into the 1:40s that lap, and his gap is back out to 0.6s.
Marquez a couple of tenths faster that lap than Bagnaia, gap back to 0.4s.
Better lap from Marquez that time, maintained the gap at half-a-second.
Half-a-second now for Bagnaia - that's as big as his lead has been over Marquez.
Really in a management phase of this race. Nobody really attacking, and with 12 laps to go there's still plenty of time for tyres to drop off.
No change at the front still. Closest battle towards the front is Espargaro versus Alex Marquez for fourth.
Martin a tenth faster than Bagnaia that lap, he's now 1.1 behind Marquez, who is about 1.5 bike lengths behind Bagnaia.
Small mistake from Bagnaia at turn five that lap but it didn't cost him anything. Marquez still on his rear wheel, of course.
Bagnaia continues to lead as we tick into the final 15 laps. Martin 1.3 seconds adrift of Marquez but he's almost a second now in front of Espargaro.
All the same at the front, but Bastianini has dropped to seventh after running wide at turn one. It's now Alex Marquez who is behind Espargaro in fifth, then Acosta in sixth.
Bagnaia still leads, now over one second back to Martin from Marquez.
Joan Mir has also crashed out at turn 10.
Bagnaia and Marquez still glued together, and Martin still there in third in front of Espargaro.
Still Bagnaia leading from Marquez, and it's a personal best lap from Martin on that lap.
Espargaro back up to fourth at turn one in front of Bastianini. They're not being dropped by Martin, though, who is now almost a second behind Marquez.
Bagnaia continues to lead, and Bastianini is back up to fourth with a pass on Espargaro at turn 10.