Tony Stewart beat Juan Pablo Montoya to pole position for Sunday's Sprint Cup series race at Pocono Raceway.

The Stewart-Haas driver and owner beat the previous benchmark set by Earnhardt Ganassi's Montoya, putting in a lap of 52.511 seconds at an average speed of 171.393 mph, less than a tenth of a second faster than the Colombian.

Stewart will start from pole for the second time this year, and also the second at Pocono, a track where he has won twice in the past.

"I'm a little surprised by myself," said Stewart. "I'm not a qualifier and this has always been my weak suit but if you're going to pick a place where you want to have track position, this is it.

"If I don't go out like I did last year and crash the thing in Happy Hour [practice] we'll have a good starting spot."

Montoya will start from the front row for the second week in a row, following his pole position at Indianapolis, where he looked to be closing in on his maiden oval win before a strategy decision dropped him back in the final stages of the race. Like Stewart, he was surprised by his qualifying lap also.

"When I crossed the line I was waiting for the guys to say I was like P15 or something and he says P1! I was like 'Are you serious or are you joking with me?'" said Montoya. "I'm kind of happy I guess... we're trying a bit of a different approach with the car and it seems to be working."

Four-time Pocono winner Denny Hamlin was third fastest despite admitting his car was not at its optimum for a flying lap, suffering a spin earlier in practice. The Joe Gibbs Racing driver was the fastest Toyota and will share the second row of the grid with fellow four-timer at the tri-oval Jeff Gordon, who was the best among the Hendrick Motorsports camp.

His team-mate Jimmie Johnson had paced practice earlier in the day and ended up sixth in qualifying, right behind Stewart's team-mate Ryan Newman. Richard Petty's AJ Allmendinger was the fastest Ford in seventh, while the Chevrolets of Richard Childress Racing's Jeff Burton, Brickyard 400 winner Jamie McMurray and Hendricks's Mark Martin rounded out the top-ten.

Brad Keselowski was the fastest Dodge in 11th, while also in a Charger, JJ Yeley was best among those having to qualify on speed taking 30th on the grid for Sunday's 500-miler. David Stremme and Max Papis both failed to make the field.