Martin smashes lap record to take pole at German Grand Prix
Pramac Racing's Martin went fastest with a time of 1:19.423, less than five-hundredths of a second faster than Miguel Oliveira, whose Trackhouse Racing teammate Raul Fernandez joins them on the front row in third.
Trackhouse Racing have struggled this season with only six top-10 finishes on their Aprilia bikes but even Martin, who is joining the Italian factory team next season, noticed the improvement from the satellite team.
"I feel really good, I feel confident. I didn't expect pole position, my lap wasn't fantastic," Martin said.
"But overall I feel competitive; Aprilia is super strong," he added with a grin.
Johann Zarco had set the lap record last year with a time of 1:21.225 but this time nine riders finished inside the 1:20 mark in a record-breaking qualifying session.
Bagnaia was fourth fastest thanks to his initial lap but the Ducati rider and reigning champion could not set a faster time after yellow flags came out when Maverick Vinales and Alex Marquez crashed in quick succession during the session.
Bagnaia sits 10 points behind Martin in the championship standings and can close the gap during the sprint later on Saturday.
Gresini Racing's Marc Marquez fractured his left index finger and also bruised his ribcage in a highside crash on Friday, and the Spaniard failed to move into Q2 after running into traffic on his final effort to make the top two to advance.
A visibly struggling Marquez had been squeezed out of the top two in Q1 and as the Gresini rider looked to set one more fast lap, he was left fuming when he was impeded by Stefan Bradl, with the Honda rider apologising to him soon after.