Jorge Lorenzo secured pole position for Sunday's San Marino MotoGP on a track where he has tasted victory in each of the last three years.
The Movistar Yamaha rider went round in one minute 33.238 seconds to register his first pole since Motegi in 2013.
Andrea Iannone pushed Lorenzo all the way, finishing just 0.051secs behind the man at the front, while nine-time world champion Valentino Rossi was third in 1min 33.302secs.
Championship leader Marc Marquez of Repsol Honda qualified fourth - the first time he had finished off the front row this season - 0.122secs off of Lorenzo.
Dani Pedrosa is fifth on his RC213V with a time just 0.058secs slower than that of Marquez, while Andrea Dovizioso (Ducati Team) is 0.021secs further back and completes the second row.
Brothers Pol Espargaro (Monster Yamaha Tech3) and Aleix Espargaro (NGM Forward Racing) are joined on the third row by Bradley Smith (Monster Yamaha Tech3).
Stefan Bradl (LCR Honda MotoGP) is 10th after a crash in qualifying, with Yonny Hernandez (Energy T.I. Pramac Racing) and Alvaro Bautista (GO&FUN Honda Gresini) behind.