Having dominated the sprint race on Saturday, Martin converted pole to a second grand prix victory of the 2024 season to open up a lead of 38 points in the championship.
Shadowing the factory Ducati of Bagnaia for much of the 27-lap contest, Martin made his decisive move on the 21st tour to take the lead.
Resisting immense pressure from Bagnaia over the final few laps, Martin’s victory was assured on the final tour when Marquez – who started 13th – moved into second at Turn 9.
Martin took the chequered flag 0.446 seconds clear of Marquez, with Bagnaia third, while Ducati team-mate Enea Bastianini recovered from a long lap penalty to fourth ahead of Aprilia’s Maverick Vinales.
Following his bike woes that ruled him out of the sprint on Saturday, Bagnaia nailed the launch of the line to grab the holeshot from Martin and Aprilia’s Aleix Espargaro.
Marquez made another solid start from 13th on the grid to get up to eighth after the opening corners.
Bagnaia and Martin quickly put a few tenths between themselves and the battle for third, which was headed by Espargaro before VR46 Ducati rider Fabio Di Giannantonio passed him at Turn 8 on lap 10.
Espargaro quickly found himself swamped by team-mate Vinales and then Marquez, with the latter two swapping places on lap 14.
Marquez moved his Gresini Ducati ahead of Di Giannantonio at the Dunlop chicane at the start of lap 17, with the latter running through the chicane trying to defend third and earning himself a long lap penalty.
Bagnaia and Martin held a two-second gap over Marquez, whose pace was better at this phase of the race then theirs.
That gap shrunk to 1.3s at the start of lap 20 when Martin made his first attempt on Bagnaia’s lead at the Dunlop chicane, but couldn’t make the move stick.
When Martin finally found his way through on the reigning world champion on the following lap – again at Dunlop – Marquez was just 0.8s behind.
Marquez quickly got onto the rear of the lead battle and the trio broke away from Vinales behind, who would come under pressure from Bastianini late on.
Martin gave Bagnaia a sniff at retaking the lead at Dunlop on lap 25 when he ran deep, but the Pramac rider held firm.
He led onto the final lap and kept the door shut to Bagnaia, whose chances were ended when Marquez scythed past on the brakes into Turn 9.
This blew Martin’s lead up to 0.446s while Marquez ensured Bagnaia had no way to strike back as they took the chequered flag.
Bastianini was handed a long lap penalty for cutting the Turn 9/10 chicane when passing Espargaro for sixth on the 12th tour.
Quickly serving the penalty, Bastianini fought back to fourth ahead of Vinales and Di Giannantonio after the VR46 rider’s violation.
Franco Morbidelli was seventh on the second Pramac Ducati, marking his best grand prix result in 2024.
Brad Binder was eighth having started last on the factory KTM, with Espargaro and Gresini’s Alex Marquez rounding out the top 10.
The final points went to Trackhouse Racing’s Raul Fernandez, LCR Honda’s Johann Zarco, Tech3 GasGas rider Augusto Fernandez, Takaaki Nakagami (LCR) and Yamaha’s Alex Rins.
Luca Marini was the final classified runner in 16th on his factory Honda, with team-mate Joan Mir crashing out.
Home hero Fabio Quartararo was running inside the top eight when he fell off his Yamaha at Turn 9 on lap 17.
VR46’s Marco Bezzecchi registered his second race crash of the weekend when he slid out of seventh at Turn 6 on lap four, while Tech3 rookie Pedro Acosta went down on the previous tour.
KTM’s Jack Miller and Trackhouse Racing’s Miguel Oliveira also failed to make the finish.