Johann Zarco produced an emphatic late display in qualifying to seal his third pole of the season at Motegi.
The Frenchman, still chasing his first win this year, was the only rider to break the 1m48s barrier, while his final three laps would all have earned him pole.
As it was his fastest time, a 1m57.888s, left him almost a quarter of a second clear of the Aspar Aprilia of Hector Faubel, who demoted team-mate and championship leader Nicolas Terol to third in the final minutes.
Terol was the first of the frontrunners to show his hand, at one point moving 0.6s clear of the field before Zarco and Faubel's late charges left him with the final spot on the front row.
Fourth went to early pacesetter Maverick Vinales on the Blusens Aprilia, which was the last bike to get within 1s of Zarco.
Alberto Moncayo's Aprilia was almost half a second back but managed to hang on to fifth, as Efren Vazquez missed out by just 0.065s with his final flying effort.
Aprilia riders rounded out the top 10, with Sandro Cortese heading Jonas Folger, Adrian Martin and Alessandro Tonucci.
There were falls for Shun'ya Mori, on Simone Grotzki's Phonica Aprilia, and Luis Salom on the RW Racing GP. Salom fell early but did enough to secure 12th, while Mori will start from 32nd ahead of fellow Japanese riders Takehiro Yamamoto (Nobby Honda) and Jun Ohnishi (Project u Honda).