Fabio Quartararo snatched the final pole of the 2019 MotoGP season by 0.032 seconds from Marc Marquez in a close Valencia Grand Prix qualifying.
The Petronas SRT rider has topped all bar one session so far this weekend, and produced the first sub 1m30s lap of the weekend late on in Q2 to secure the sixth pole of his rookie season.
A frantic opening salvo in Q2 led to top spot changing hands four times, with reigning champion Marquez - who crashed in the preceding practice four - setting the initial pace with a 1m30.800s, though this was immediately bettered by 0.395s by Pramac's Jack Miller.
Rider market shock
Maverick Vinales, who topped fourth practice, guided his works Yamaha to a 1m30.365s, with Marquez moving back up to second as 0.040s covered the top three.
Quartararo soon interrupted this with his second effort of 1m30.235s, which put him just over a tenth out of reach as the first runs concluded.
Miller reclaimed top spot with a 1m30.086s with just over two minutes remaining, though he was pipped by Quartararo by 0.079s just a moment later.
Marquez's penultimate lap put him just 0.003s outside of Quartararo's benchmark, but he would be unable to improve on his final attempt and remained second.
Quartararo posted a 1m29.978s on his last flying lap to take pole, while Miller was resigned to the final place on the front row in third.
Vinales heads row two from the second SRT Yamaha of Franco Morbidelli. Andrea Dovizioso ended the session as top Ducati runner in sixth.
Joan Mir beat Suzuki team-mate and Q1 pacesetter Alex Rins to seventh, with LCR Honda's Cal Crutchlow and Danilo Petrucci (Ducati) rounding out the top 10.
Pol Espargaro joined Rins in advancing from Q1 despite riding his last two laps without traction control - which led to a spectacular sideways moment as he rounded Turn 13.
The KTM rider could only manage 11th in the end, while Valentino Rossi suffered a mystifying loss of pace in 12th - close to a second off pole.
While the battle for the top two Q2 places between Rins and Espargaro was tight, with just 0.005s splitting them, LCR stand-in Johann Zarco proved unable to join in.
Missing the Q2 cut by close to three tenths, Zarco's last race as Takaaki Nakagami's replacement will commence from 13th on the grid ahead of Ducati wildcard Michele Pirro and the Aprilia of Aleix Espargaro.
Farewell to Lorenzo
Jorge Lorenzo will start his final grand prix from 16th, after he outpaced the KTM of Mika Kallio.
Tech3 rookie Iker Lecuona was a commendable 19th in his first MotoGP qualifying session.
Avintia's Karel Abraham was the only crasher in qualifying. He'll start 21st.
Get unlimited access to the world’s best motorsport journalism with Autosport Plus