Dani Pedrosa continued his dominance at the Grand Prix of Spain to claim pole position ahead of team-mate Marc Marquez.
Repsol Honda rider Pedrosa topped the timesheets in three of the four practice sessions at Jerez, Marquez leading the way in the other.
And he did the same again in qualifying, edging out Marquez to take top spot after a back-and-forth battle in which he finally clinched pole in the last minute.
The high point of the season so far for Pedrosa has been a third-placed finish in the previous race at the Circuit of the Americas.
But he will hope to go two better on Sunday after setting the pace with a time of one minute and 38.249 seconds.
Marquez finished just 0.049 seconds off the pace, with LCR Honda's Cal Crutchlow completing the front row.
Championship leader Valentino Rossi could only manage seventh, one spot ahead of former Yamaha team-mate Jorge Lorenzo.
The man who Rossi now shares the paddock with, Maverick Vinales, qualified fourth as he seeks to make it three wins in four races.
Suzuki's Andrea Iannone was fifth ahead of Monster Yamaha's Johann Zarco.