Jerez de la Frontera, Spain - Dani Pedrosa narrowly edged out world champion Marc Marquez to start from pole for Sunday's Spanish Grand Prix after a thrilling duel between the Honda team-mates.
Despite a late final attempt from Marquez to claim his third pole of the season, he fell 0.049 seconds short of Pedrosa's best time of 1min 38.249sec.
Pedrosa has been in fine form all weekend at the Jerez track as he also topped the timesheets in three of the four practice sessions before claiming his first pole since the Malaysian Grand Prix in 2015.
"Since the return of the Michelin tyres (in 2016) I've found it hard to get on the first row," said Pedrosa.
"I had a good feeling and I tried to make the most of my second lap. I had Marc right behind me so I knew it would be hard for him to set a faster time than me."
The two Hondas had left the garage almost side by side to set their flying laps.
However, after Pedrosa set the time to beat, Marquez had one last go at bettering his teammate and may even have landed pole but for a slight wobble before entering the home straight.
"Where I normally like it on the straight, I came in too fast and nearly went flying off, but even so it was a good lap and I am happy," said three-time world champion Marquez.
Britain's Cal Crutchlow completes the front row despite his qualifying session being interrupted by repeated stings from a wasp that got inside his racing leathers.
"After doing my fast lap I felt something go inside," said Crutchlow. "Then it started to sting me five times or something I had to stop to get it out."
It was a disappointing Saturday for Yamaha duo and the leading two riders in the championship standings Valentino Rossi and Maverick Vinales.
Italian veteran Rossi leads Vinales by just six points after three races as he goes for a long-awaited 10th title, but will start from seventh.
Vinales, who won the first two races of the season in Qatar and Argentina before crashing out at the Grand Prix of the Americas last time out, leads the second row from fourth.
Andrea Iannone and Johann Zarco complete the second row.
Three-time Spanish GP winner Jorge Lorenzo's poor start to life with Ducati continued as he could only manage eighth fastest.