Jorge Lorenzo will start in pole position at Sunday's Japanese MotoGP after finishing Satuday's qualifying session at Motegi just ahead of Yamaha team-mate Valentino Rossi.
The two Championship pace-setters traded fastest times during the session, as the pole position record fell on four occasions.
Rossi, who leads the Championship by 14 points over Lorenzo, initially went fastest as he followed his team-mate around the Twin Ring circuit.
Lorenzo, nevertheless, recovered from a relatively slow opening lap to move ahead for the first time on his next attempt.
During the final stages of Q2, Rossi went ahead again, before Lorenzo went 0.081s clear of Rossi on his final lap with a time of 1:43.790, despite some small mistakes in the first sector.
Honda rider Marc Marquez claimed the final front row spot after setting the third fastest time of the day, albeit some four tenths of a second behind the Yamaha pair, while Ducati's Andrea Dovizioso and Andrea Iannone were fourth and fifth.
Marquez's Honda team-mate Dani Pedrosa completes the second row.
Suzuki rider Aleix Espargaró starts in the third row, just ahead of LCR's Cal Crutchlow, while on the Monster Yamaha Bradley Smith finished in ninth place despite crashing twice in the 15-minute Q2 session.
Maverick Viñales, Pol Espargaró and Scott Redding complete the fourth row.
Aprilia's Stefan Bradl narrowly missed out on a Q2 berth but had to settle for 13th place, just ahead of Yonny Hernández and Yamaha wild card Katsuyuki Nakasuga.
Álvaro Bautista starts in 16th, ahead of Danilo Petrucci, who could only manage to move up to 17th on his final lap of the session.
Next were Héctor Barberá, Takumi Takahashi and Eugene Laverty, while outgoing Aspar rider Nicky Hayden completed the top 20.
Alex de Angelis did not participate in qualifying after serious crash in the final practice session, but is reportedly "conscious and breathing" after having been airlifted to a nearby medical facility.
Collated qualifying times from Motegi:
1. Jorge Lorenzo ESP Movistar Yamaha MotoGP (YZR-M1) 1m 43.790s [Lap 8/8] 303km/h (Top Speed)
2. Valentino Rossi ITA Movistar Yamaha MotoGP (YZR-M1) 1m 43.871s 0.081s [7/7] 303km/h
3. Marc Marquez ESP Repsol Honda Team (RC213V) 1m 44.216s 0.426s [7/7] 306km/h
4. Andrea Dovizioso ITA Ducati Team (Desmosedici GP15) 1m 44.322s 0.532s [7/7] 310km/h
5. Andrea Iannone ITA Ducati Team (Desmosedici GP15) 1m 44.436s 0.646s [6/7] 312km/h
6. Dani Pedrosa ESP Repsol Honda Team (RC213V) 1m 44.582s 0.792s [8/8] 309km/h
7. Aleix Espargaro ESP Team Suzuki Ecstar (GSX-RR) 1m 44.809s 1.019s [7/7] 297km/h
8. Cal Crutchlow GBR LCR Honda (RC213V) 1m 44.932s 1.142s [3/7] 303km/h
9. Bradley Smith GBR Monster Yamaha Tech 3 (YZR-M1) 1m 45.067s 1.277s [5/5] 305km/h
10. Maverick Viñales ESP Team Suzuki Ecstar (GSX-RR)* 1m 45.081s 1.291s [5/6] 300km/h
11. Pol Espargaro ESP Monster Yamaha Tech 3 (YZR-M1) 1m 45.219s 1.429s [2/8] 302km/h
12. Scott Redding GBR Estrella Galicia 0,0 Marc VDS (RC213V) 1m 45.333s 1.543s [7/7] 301km/h
13. Stefan Bradl GER Factory Aprilia Gresini (RS-GP) 1m 45.432s 299km/h
14. Yonny Hernandez COL Octo Pramac Racing (Desmosedici GP14.2) 1m 45.438s 304km/h
15. Katsuyuki Nakasuga JPN Yamaha Factory Racing (YZR-M1) 1m 45.496s 300km/h
16. Alvaro Bautista ESP Factory Aprilia Gresini (RS-GP) 1m 45.608s 299km/h
17. Danilo Petrucci ITA Octo Pramac Racing (Desmosedici GP14.2) 1m 45.691s 302km/h
18. Hector Barbera ESP Avintia Racing (Desmosedici GP14 Open) 1m 45.724s 306km/h
19. Takumi Takahashi JPN Team HRC (RC213V) 1m 45.743s 303km/h
20. Eugene Laverty IRL Aspar MotoGP Team (RC213V-RS)* 1m 45.751s 298km/h
21. Nicky Hayden USA Aspar MotoGP Team (RC213V-RS) 1m 45.843s 295km/h
22. Jack Miller AUS LCR Honda (RC213V-RS)* 1m 46.039s 299km/h
23. Loris Baz FRA Forward Racing (Forward Yamaha)* 1m 46.048s 293km/h
24. Mike Di Meglio FRA Avintia Racing (Desmosedici GP14 Open) 1m 46.179s 300km/h
25. Toni Elias SPA Forward Racing (Forward Yamaha) 1m 46.256s 300km/h
26. Kousuke Akiyoshi JPN AB Motoracing (RC213V-RS) 1m 47.760s 291km/h
27. Alex De Angelis RSM E-Motion IodaRacing (ART) No Time