Bagnaia takes crucial pole for final Grand Prix as Martin qualifies fourth
Ducati's Bagnaia, who won the riders championship in the past two seasons, is 24 points behind Pramac Racing's Martin ahead of the Solidarity Grand Prix.
Bagnaia was fastest in one minute 38.641 seconds while Aprilia's Aleix Espargaro was second heading into the final grand prix of his MotoGP career. Gresini Racing's Marc Marquez completed the front row.
"I need to put more bikes between me and Jorge. He's starting fourth so he's very close but (I am) happy overall in terms of pace," Bagnaia said.
Martin, who can clinch the title with a victory in the sprint later on Saturday, is joined on the second row by Pramac Racing teammate Franco Morbidelli and rookie Pedro Acosta of the Red Bull GasGas Tech3 team.
The final race is being held in Barcelona, which already hosted a grand prix in May, after catastrophic floods in Valencia forced organisers to move the season finale.