Marc Marquez will start on pole for the 11th time this season after topping the timesheets in qualifying ahead of the Aragon Grand Prix.
The Repsol Honda rider is looking to make history this weekend by equalling Mick Doohan's 17-year record of 12 wins in a season and he gave himself the best chance as he snatched pole on his final flying lap.
Marquez struggled last time out at the San Marino Grand Prix but the MotoGP championship leader looked at home in Aragon, eclipsing team-mate and nearest rival Dani Pedrosa in the closing seconds of qualifying in a time of one minute, 47.187seconds.
Jorge Lorenzo (Yamaha) started the session well and set the quickest time in the opening stages, but Andrea Iannone, so impressive in free practice, assumed top spot for Pramac Racing before the Repsol Honda riders took over in their battle for pole.
Marquez was the first man to beat Iannone's time and he went even quicker before Pedrosa showed he was not out of the fight as he claimed provisional pole with seconds to spare.
However, such is Marquez's talent he can never be ruled out of contention and with time running out he put an impressive lap together to snatch top spot.
At the start of the Spaniard's 11th, and final, lap he was marginally slower in the first sector but made up ground in the final two to take pole by 0.362secs, with Iannone having to settle for third a further 0.136secs back.
Pol Espargaro (Yamaha Tech3) put himself into fourth place with a time of 1:47.865secs, while Ducati's Cal Crutchlow completed the top five.
Having started well Lorenzo struggled as the session went on and was only able to record the seventh quickest time, giving him a huge task if he wants to claim a victory on Sunday.
Valentino Rossi (Yamaha) and Hector Barbera (Avintia Racing) were the two riders to make it through from first qualifying with Rossi able to take sixth place for Sunday's race, while Barbera did not set a time and will start 12th.
Meanwhile, Nicky Hayden's return from surgery saw him fail to make the top 12 and will start 18th in his Drive M7 Aspar.