Championship leader Lorenzo grabbed pole in the final seconds ahead of his main title rivals and Repsol Honda team-mates Casey Stoner and Dani Pedrosa.
Lorenzo left it until the last lap to claim a fourth consecutive pole ahead of defending champion Stoner, who had posted a new track record lap just a few laps before.
Pedrosa had set the pace in Friday's practice session but could not match the front two and had to settle for the final place on the front row of the grid.
Yamaha dominated the second row with Lorenzo's team-mate Ben Spies joined by Yamaha Tech 3 team-mates Cal Crutchlow and Andrea Dovizioso who have both been tipped to replace him in the factory team next season.
Spies, who walked away after a crash in the qualifying session, announced earlier this week that he would be leaving the factory Yamaha team at the end of the season.
Crutchlow, who suffered a crash Friday, and Dovizioso will be keen to impress Yamaha bosses as they battle for fourth spot in the championship points standings and the chance to replace Spies.
San Carlo Honda Gresini's Álvaro Bautista, Ducati's Nicky Hayden and LCR Honda's Stefan Bradl make up row three.
Former world champion Nicky Hayden, who this week signed on for another year with Ducati, was quicker than team-mate and multiple champion Valentino Rossi who rounded out the top 10 in qualifying.