Maverick Vinales took pole position for MotoGP's Aragon Grand Prix in a thrilling qualifying session, as Marc Marquez crashed and an injured Valentino Rossi snatched a front-row spot.
Marquez, who has been on pole at Aragon every year since his premier class debut in 2013, seemed well set for a fifth consecutive pole at the Spanish track at the halfway stage of Q2, after he became the first rider to break the 1m48s barrier this weekend.
The reigning champion's benchmark of 1m47.963s put him three tenths up on the pack, led by Q1 pacesetter Jorge Lorenzo, before Vinales slotted between his two countrymen on a 1m48.142s.
But at the start of the final runs, Marquez's pole bid unravelled as the Honda rider suffered a high-speed off at Turn 12 with two minutes left on the clock.
Moments later, Yamaha's Rossi - just 23 days on from breaking his right leg in a motocross crash - jumped to the top of the times on a 1m47.815s.
Any hopes of the Italian taking a shock pole on his MotoGP return, however, were ended by his teammate Vinales, who went 0.180s faster on a 1m47.635s.
Ducati man Lorenzo then split the Yamahas with a time exactly one tenth slower than Vinales.
Cal Crutchlow ended up best of the Hondas on his satellite LCR machine in fourth, only 0.015s behind Rossi, while Marquez found himself pushed down to fifth, ahead of works teammate Dani Pedrosa.
Joint-points leader Andrea Dovizioso was a subdued seventh on the second factory Ducati, half a second down on Vinales.
Aleix Espargaro (Aprilia), Alvaro Bautista (Aspar Ducati) and Andrea Iannone (Suzuki) completed the top 10, while Tech 3 Yamaha's Johann Zarco and KTM wildcard Mika Kallio completed the Q2 field.
Kallio had embarrassed both of KTM's regular riders by qualifying directly into Q2 with the fifth-fastest time in FP3, but crashed late on and was demoted to 12th.
Lorenzo tops Q1
Holding the two qualification spots early in Q1 were Lorenzo and Marc VDS Honda rider Jack Miller, before Karel Abraham managed to bump out the latter with a tow from the former.
Miller responded at the start of the second runs, getting within 0.128s of Lorenzo's benchmark, but he was edged out moments later by Zarco by a margin of just 0.009s.
That means Miller will start 13th ahead of Pol Espargaro's KTM and Abraham, with Danilo Petrucci's Pramac Ducati behind on a lowly 16th.
Jonas Folger on the second Tech 3 Yamaha recovered from a brief trip to hospital in nearby Alcaniz following his FP3 crash to take 18th.
Bradley Smith, who is under pressure from his KTM bosses to improve his results, was 23rd fastest, beating only the second Aprilia of Sam Lowes.