Bagnaia takes pole in Ducati grid lockout at Aragon GP
Italian Bagnaia, winner of the last four races, posted a time of 1:46.069 to snatch pole by 0.090 seconds from Ducati factory team mate Jack Miller and Gresini Racing's Enea Bastianini completed the front row.
Aprilia's Espargaro finished fourth ahead of Pramac Ducati rider Johann Zarco as championship leader Quartararo took sixth place with his final lap.
Honda rider Marc Marquez, a six-times MotoGP champion, finished 13th on his return to racing, after recovering from surgery and missing the last six rounds of the championship.
Suzuki rider Joan Mir withdrew from the Aragon GP weekend after the end of the third practice session earlier on Saturday due to an ankle injury. The 2020 world champion will also sit out next weekend's Japanese GP at Motegi.