Danny Kent claimed his first ever Moto3 pole position with a superb last-gasp effort in qualifying at Motegi.
The Briton beat championship leaders Maverick Vinales and Sandro Cortese to top spot, as qualifying boiled down to a thrilling three-way shootout in the final two minutes.
Kent was the first to make his move, going fastest with a 1m58.804s.
Cortese soon demoted him however, setting a new weekend best of 1m8.669s just moments before the chequered flag fell.
Kent and Vinales were both out on track however and were both under Cortese's new benchmark.
Vinales crossed the line first, going top for all of two seconds before Kent, benefiting from Vinales's slipstream, sealed pole with a 1m58.371s, two tenths clear of the pack.
His Ajo KTM team-mate Zulfahmi Khairuddin will start directly behind him in fourth, meaning Vinales was the only Honda rider to crack the top four.
Alessandro Tonucci (Italia FMI FTR-Honda) almost joined him, running fourth until Khairuddin demoted him in the final minute.
Luis Salom (RW Kalex-KTM) likewise improved late on to relegate Jonas Folger (Aspar Kalex KTM) into seventh.
Folger suffered two bike failures during the session, the latter of which came five minutes from the end, forcing him to miss the final moments of the session.
Pos Rider Team/Bike Time Gap 1. Danny Kent Ajo KTM 1m58.371s 2. Maverick Vinales Avintia FTR-Honda 1m58.574s + 0.203s 3. Sandro Cortese Ajo KTM 1m58.669s + 0.298s 4. Zulfahmi Khairuddin Ajo KTM 1m58.951s + 0.580s 5. Alessandro Tonucci Italia FMI FTR-Honda 1m59.072s + 0.701s 6. Luis Salom RW Kalex-KTM 1m59.097s + 0.726s 7. Jonas Folger Aspar Kalex KTM 1m59.125s + 0.754s 8. Louis Rossi Germany FTR-Honda 1m59.213s + 0.842s 9. Efren Vazquez Laglisse Honda 1m59.287s + 0.916s 10. Romano Fenati Italia FMI FTR-Honda 1m59.359s + 0.988s 11. Miguel Oliveira Monlau Honda 1m59.494s + 1.123s 12. Niccolo Antonelli Gresini Honda 1m59.652s + 1.281s 13. Alex Rins Monlau Honda 1m59.653s + 1.282s 14. Arthur Sissis Ajo KTM 1m59.686s + 1.315s 15. Alberto Moncayo Aspar Kalex-KTM 1m59.904s + 1.533s 16. Adrian Martin Laglisse Honda 1m59.945s + 1.574s 17. Alex Marquez Estrella Suter Honda 1m59.949s + 1.578s 18. Brad Binder RW Kalex-KTM 1m59.974s + 1.603s 19. Jakub Kornfeil Ongetta FTR-Honda 1m59.998s + 1.627s 20. Alan Techer Technomag-CIP TSR-Honda 2m00.021s + 1.650s 21. Hyuga Watanabe Project u Honda 2m00.044s + 1.673s 22. Jack Miller Caretta Honda 2m00.177s + 1.806s 23. Niklas Ajo TT Motion KTM 2m00.386s + 2.015s 24. Toni Finsterbusch MZ-Honda 2m00.460s + 2.089s 25. Isaac Vinales Ongetta FTR-Honda 2m00.526s + 2.155s 26. John McPhee Caretta Honda 2m00.755s + 2.384s 27. Yuudai Kamei 18 Garage Honda 2m00.940s + 2.569s 28. Giulian Pedone Ambrogio Oral 2m00.987s + 2.616s 29. Kenta Fujii Technomag-CIP TSR-Honda 2m01.233s + 2.862s 30. Josep Rodriguez Ongetta FTR-Honda 2m01.256s + 2.885s 31. Luca Amato Aspar Kalex KTM 2m01.500s + 3.129s 32. Danny Webb Mahindra 2m02.362s + 3.991s 33. Armando Pontone Ioda 2m03.819s + 5.448s 34. Riccardo Moretti Mahindra 2m05.450s + 7.079s