The factory Ducati rider backed up his Sprint triumph on Saturday with a brilliant win on Sunday, Bastianini timing his charge to perfection.
Having sat back in fourth at mid-race distance, a timely pass on Aleix Espargaro helped put him in a position to hunt down fellow Ducati riders Francesco Bagnaia and Martin to win.
While Martin missed out on victory, he did emerge from the race with a narrow three-point series lead over Bagnaia thanks to finishing a spot clear of his rival in second.
Bagnaia made a rapid start to the 20-lap race, gapping the field – led by Martin – by six-tenths on the opening lap.
That was as big as the advantage got, though, Martin, pole-sitter Espargaro and Bastianini able to collectively claw onto the back of the leader in the early laps.
They ran in that order until the mid-point of the race, at which point Martin closed right onto the back of the leader.
At the same time Espargaro started to fall back, Bastianini executing a crucial pass on lap 10 to grab third and set off after the Ducatis ahead of him.
A lap later the lead changed hands, Bagnaia unable to keep an improving Martin behind.
The reigning world champion’s day continued to unravel from there, his teammate charging past into second place two laps later.
Bastianini then ramped up the pressure on Martin in the laps that followed, closing to within half a second with four laps to run as Bagnaia faded into the distance.
Within two laps the gap was nothing, Martin then running too deep into turn 3 on the penultimate to allow Bastianini into a lead he would hold until the finish.
“It was a very difficult race,” said Bastianini. “I committed some mistakes at the start and was in fourth place. I closed the gap to Aleix and to [Bagnaia].
“In the last four, five laps Jorge pushed a lot and it was difficult to close the gap to him. But the last two or three laps always I have something more, and today was the same.”
Second was enough for Martin to narrowly wrangle the series lead from Bagnaia, who finished third but had almost drifted back into the clutches of fourth-placed Marc Marquez.
Fabio di Giannantonio finished a fine fifth, the highlight of his race a thrilling mid-race battle with Alex Marquez.
Once clear of that he was able to hunt down Espargaro, who was demoted to sixth ahead of Marquez, Marco Bezzechi, Pedro Acosta and Franco Morbidelli.
Jack Miller ran as high as eighth early in the race but slipped back to 12th at the finish, while Remi Gardner finished 18th on the Yamaha wildcard entry.