Marco Simoncelli takes his first MotoGP pole
The frizzy-haired Italian set the fastest lap at the end of the qualifying session with a time of 1:42.413, just 0.016 of a second ahead of Stoner on another Honda.
The Australian had been quickest in the three practice sessions and was aiming for his fourth pole in five races.
Simoncelli was whistled at by a hostile home crowd for his part in the incident which saw local favourite Dani Pedrosa crash and break his collarbone at Le Mans three weeks ago.
The Spaniard has had to miss today's race at Barcelona's Circuit de Catalunya.
Stoner, who is second in the championship, came in ahead of Spanish world champion and overall leader Lorenzo on a Yamaha.
The second row comprises American Ben Spies, Italian Andrea Dovizioso and Britain's Cal Crutchlow.