Petronas Yamaha rider Fabio Quartararo bagged the fourth pole of his rookie MotoGP campaign in Thailand, despite crashing on his final lap.
Quartararo posted the fastest-ever MotoGP lap of Buriram, eclipsing Dani Pedrosa's benchmark from 2018 pre-season testing, as he saw off fellow Yamaha rider Maverick Vinales and championship leader Marc Marquez - who also crashed.
Marquez, the sole Honda representative in Q2, trailed Vinales and Quartararo after his first attempt, but fired in a 1m30.109s to take the lead next time by.
Quartararo then responded with the first sub-1m30s lap of the weekend, a 1m29.920s, and Marquez could only come within 0.011 seconds of that effort before concluding his opening run.
Having switched to a new rear tyre, Marquez was over a quarter of a second up on Quartararo's benchmark when he slid off at the Turn 5 left-hander and dropped out of the pole battle.
Moments later, Quartararo came across the line with an improved 1m29.719s lap, and was then even quicker after two sectors on his final attempt - only to emulate Marquez by also going off at Turn 5.
The chequered flag had flown by that point and Vinales, who by then was using a third new rear tyre, stood as the only threat to Quartararo's pole, before ultimately coming up 0.106s short over the line.
Yamaha's young stars
With Vinales and Marquez making up the front row, Quartararo's team-mate Franco Morbidelli was best of the rest in fourth, albeit seven tenths down on his team-mate.
Ducati's Danilo Petrucci had progressed from Q1 despite his Q2 participation having looked under threat when he failed to put together a clean lap on the opening run.
He recovered to comfortably top the first segment, and went on to qualify fifth, beating Pramac rider Jack Miller by 0.075s to the honour of being top Ducati.
Andrea Dovizioso followed his fellow Ducati riders in seventh, ahead of Suzuki's Joan Mir and the fourth Yamaha of Valentino Rossi.
Rossi had crashed at Turn 5 in the opening minutes of Q2, but was back in time to switch to his second bike and salvage ninth place.
Alex Rins was 10th for Suzuki, and will be joined on the fourth row by the Espargaro brothers, with Pol (KTM) heading Aleix (Aprilia).
LCR Honda's Cal Crutchlow occupied one of the two Q2 transfer spots for most of the opening segment, but was demoted by KTM rider Espargaro by just 0.013s in the final minutes.
He sought to strike back and pushed hard during a last-ditch effort after the chequered flag, but struggled to get the bike stopped braking late into Turn 12 and was forced to concede defeat, settling for 13th on the grid.
Takaaki Nakagami slotted in behind his British team-mate in 14th, albeit four tenths off Crutchlow, while Francesco Bagnaia will join the LCR duo on the fifth row.
Bagnaia was on course for his fastest lap when he slid off into the gravel at the Turn 7 right-hander.
Marquez's factory Honda team-mate Jorge Lorenzo will be 19th on the grid, having lapped nine tenths off the pace in Q1.
Get unlimited access to the world’s best motorsport journalism with Autosport Plus