Nicky Hayden was denied his first MotoGP pole position as a Ducati rider by just 0.1sec in the final minute of qualifying at Sepang on Saturday.
The 2006 world champion, on pole five times with Honda between 2003 and 2007, had been only 15th and 11th in the two free practice sessions in Malaysia.
Hayden, who lost out to world championship leader Jorge Lorenzo, admitted he had surprised himself.
“This is a bit of a surprise, I didn't expect to be on the front row today," said the American, after taking only his second front row start on a Desmosedici. "We only missed pole by one tenth but don't anybody feel sorry for us, we're pretty happy!
"The lap itself was obviously a good one, I don't think I could have got any more out of myself or the bike, but overall we've done a good job today.
"We were struggling yesterday but we went back to a setting that worked for us in the test and even though I didn't get the lap time this morning I told the guys not to make too many changes to the bike because I felt comfortable and knew I could improve purely through riding."
If Hayden was pleasantly surprised, team-mate Casey Stoner - winner of the last two races - expected better than fifth.
“I'm a little disappointed with the way qualifying went today," said the Australian. "We made a little progress with the race setting on the harder tyre. We didn't get a lot of laps in but we are happy with the work we did on the bike and feel reasonably confident.
"When I went to use the softer compound to set a qualifying lap on we lost feeling completely. There was no traction on the rear yet it was still pushing the front at the same time.
"We couldn't do the lap time we wanted or even deserved but we know our pace is faster than a couple of the guys in front of us on the grid so we'll see if we can get past them in the race.”