Fabio Quartararo went from being on a stretcher following a high-speed crash to securing pole for the Aragon Grand Prix.
Championship leader Quartararo was carried off the side of the track with a hip injury after going down hard at turn 14 during the final practice session at Motorland on Saturday.
The Petronas Yamaha rider was seen using a crutch in the paddock but was cleared to return to the track after a trip to the medical tent revealed he had not broken anything.
Quartararo astonishingly went through the pain barrier to secure first place on the grid ahead of Maverick Vinales, with Cal Crutchlow qualifying in third.
Frenchman Quartararo also crashed on Friday as cool conditions made life difficult for the riders, but he has a great opportunity to extend his advantage in the battle for the title on Sunday.
A lap of one minute, 47.076 seconds gave him back-to-back poles, having started at the front at Le Mans last weekend before finishing back in ninth.
Joan Mir, 10 points behind Quartararo in the riders' standings, will start from sixth, while Andrea Dovizioso was furious after failing to make it out of Q1 and will have to try and work his way up from 13th.
No Ducati riders made it through to Q2 automatically but Jack Miller was able to take fifth behind Franco Morbidelli, while Danilo Petrucci - winner of the French Grand Prix - qualified in eighth.
1. Fabio Quartararo (Petronas Yamaha) 1:47.076
2. Maverick Vinales (Monster Energy Yamaha) +0.046s
3. Cal Crutchlow (LCR Honda) +0.229s
4. Franco Morbidelli (Petronas Yamaha) +0.241s
5. Jack Miller (Pramac Racing) +0.337s
6. Joan Mir (Suzuki Ecstar) +0.603s
7. Takaaki Nakagami (LCR Honda) +0.683s
8. Danilo Petrucci (Ducati) +0.848s
9. Aleix Espargaro (Aprilia) +0.912s
10. Alex Rins (Suzuki Ecstar) +0.959s
11. Alex Marquez (Repsol Honda) +1.113s
12. Pol Espargaro (Red Bull KTM Factory Racing) +1.126s