Pol Espargaro recovered from a first-minute crash to take a stunning Moto2 pole position for this weekend's season-opening Qatar Grand Prix.
The Spaniard looked dead and buried when he missed his turn-in point for Turn 6 on his first flying lap of the Losail circuit and fell in the gravel on the outside of the corner.
But after remounting his Pons Kalex and stopping in the pits for checks, Espargaro headed back out and occupied seventh spot by the mid-way point of the session.
He seemed set for a second-row starting spot as he broke the timing beam in sector three of his last lap 0.4s adrift of Takaaki Nakagami's previous benchmark.
But, aided by a tow down the start/finish straight from Johan Zarco, Espargaro crossed the line in 2m00.882s to knock the Japanese rider off pole by just over a tenth of a second.
It was Espargaro's ninth pole in Moto2 and Italtrans rider Nakagami equalled his career-best too.
A late flyer from Mika Kallio snuck the Marc VDS rider in ahead of his British team-mate Scott Redding - who had led the session for the opening 30 minutes.
Dominique Aegerter was another to improve late on. The Swiss rider will start fifth ahead of Julian Simon and Nico Terol, who ran into the gravel immediately after setting his best time with two minutes remaining.
Among the other crashers were Moto3 world champion Sandro Cortese, who is making his Moto2 debut this weekend, Axel Pons, Mattia Pasini and Sergio Gadea.
Pos Rider Team/Bike Time Gap 1. Pol Espargaro Pons Kalex 2m00.882s 2. Takaaki Nakagami Italtrans Kalex 2m01.014s + 0.132s 3. Mika Kallio Marc VDS Kalex 2m01.041s + 0.159s 4. Scott Redding Marc VDS Kalex 2m01.089s + 0.207s 5. Dominique Aegerter Technomag Suter 2m01.120s + 0.238s 6. Julian Simon Italtrans Kalex 2m01.447s + 0.565s 7. Nicolas Terol Aspar Suter 2m01.454s + 0.572s 8. Esteve Rabat Pons Kalex 2m01.462s + 0.580s 9. Marcel Schrotter SAG Kalex 2m01.541s + 0.659s 10. Mike di Meglio JIR Motobi 2m01.573s + 0.691s 11. Simone Corsi Forward Speed Up 2m01.619s + 0.737s 12. Alex de Angelis Forward Speed Up 2m01.647s + 0.765s 13. Sandro Cortese Intact Kalex 2m01.841s + 0.959s 14. Johann Zarco Ioda Suter 2m01.885s + 1.003s 15. Anthony West QMMF Speed Up 2m01.944s + 1.062s 16. Jordi Torres Aspar Suter 2m02.001s + 1.119s 17. Xavier Simeon SAG Kalex 2m02.125s + 1.243s 18. Ricky Cardus Forward Speed Up 2m02.266s + 1.384s 19. Ratthapark Wilairot Gresini Suter 2m02.335s + 1.453s 20. Toni Elias Avintia Kalex 2m02.403s + 1.521s 21. Axel Pons Pons Kalex 2m02.432s + 1.550s 22. Louis Rossi Tech 3 2m02.607s + 1.725s 23. Yuki Takahashi Tady Moriwaki 2m02.800s + 1.918s 24. Randy Krummenacher Technomag Suter 2m02.908s + 2.026s 25. Mattia Pasini Forward Speed Up 2m03.006s + 2.124s 26. Danny Kent Tech 3 2m03.039s + 2.157s 27. Doni Tata Pradita Gresini Suter 2m04.177s + 3.295s 28. Kyle Smith Avintia Kalex 2m04.436s + 3.554s 29. Steven Odendaal Arginano Speed Up 2m04.657s + 3.775s 30. Rafid Topan Sucipto QMMF Speed Up 2m04.731s + 3.849s 31. Alberto Moncayo Arginano Speed Up 2m04.873s + 3.991s 32. Sergio Gadea Gresini Suter 2m05.869s + 4.987s