Valentino Rossi claimed his first pole position of the season with a blistering final lap at the Spanish Grand Prix in Jerez.
Not since Rossi claimed pole in Assen last June has the Movistar Yamaha started a MotoGP race at the front of the grid, but the Italian outpaced Jorge Lorenzo and Marc Marquez in their homeland on Saturday.
The six-time MotoGP champion left it late to set the quickest time, clocking one minute 38.736 seconds on his final lap to end his wait for a first pole of the year after he had also been quickest in the final practice session.
Rossi crashed out in Austin last time out, but stands a great chance of responding with a victory this weekend.
The 37-year-old's Ducati-bound team-mate Lorenzo looked set to take his sixth pole in Jerez, but had to settle for second place on the grid after he was 0.122secs off the pace in a dramatic end to qualifying.
Championship leader Marquez will start third on Sunday, when he will attempt to increase his 21-point advantage over fellow Spaniard Lorenzo.
Andrea Dovizioso will start at the front of the second round ahead of Maverick Vinales and Aleix Espargaro, while Dani Pedrosa will begin back in seventh.
1. Valentino Rossi (Movistar Yamaha): 1:38.736secs
2. Jorge Lorenzo (Movistar Yamaha): 1:38.858s
3. Marc Marquez (Repsol Honda): 1:38.891s
4. Andrea Dovizioso (Ducati): 1:39.580s
5. Maverick Vinales (Suzuki Ecstar): 1:39.581s
6. Aleix Espargaro (Suzuki Ecstar): 1:39.588s
7. Dani Pedrosa (Respol Honda) 1:39.678s
8. Pol Espargaro (Monster Yamaha Tech 3) 1:39.720s
9. Hector Barbera (Avintia Racing): 1:39.742s
10. Cal Crutchlow (LCR Honda): 1:39.881s