Jerez - Seven-time world champion Valentino Rossi outgunned championships rivals Jorge Lorenzo and Marc Marquez to take his first pole position of the season for Sunday's Spanish Grand Prix in Jerez.
Rossi snatched pole from Yamaha teammate Lorenzo on his final lap by just over a tenth of a second with championship leader Marquez completing the front row in third.
The Italian has won seven times in Jerez, but hasn't started from pole since 2005.
"I'm delighted. I felt comfortable from the start of the weekend, but especially this morning," Rossi told Spanish TV station Movistar+.
"I knew I could be competitive, but to compete with Jorge and Marc is not easy. To start from pole is always a special feeling and we'll see how the race goes, but it will be difficult."
Rossi insisted before qualifying that he needed to finish on the podium ni southern Spain after crashing out in Austin at the Grand Prix of the Americas two weeks ago to leave him already 33 points behind bitter rival Marquez in the championship standings.
However, his flying final lap caught defending world champion Lorenzo by surprise as he was shunted into second place having gone fastest in all four practice sessions.
"I had a pretty good lap, but in the end Valentino at the last took the pole position," said Lorenzo, who announced his decision to leave Yamaha for Ducati next season earlier this week.
"The important thing is I think we have rhythm on the hard tyre, we found a good setting on the final practice and we'll see tomorrow in what will be a hard race."
Despite failing to add to his poles in the two previous races in Austin and Argentina, Marquez was content with a place on the front row having had a last minute set up change between the final practice session and qualifying.
"We made a set up change between the fourth practice session and qualifying which we don't normally do and for that reason I did consistent laps which I don't normally do in qualifying to adapt better," said the two-time world champion.
"I am happy because I knew the pole would be difficult. The two Yamahas are that bit ahead, but I think we can be satisfied and we'll see tomorrow if I can cope with the pace of those two."
Marquez's Honda teammate Dani Pedrosa's difficult start to the season continued as he could only seventh fastest.
Ducati's Andrea Dovizioso and Suzuki's Spanish duo Maverick Vinales and Aleix Espargaro will start on the second row.