Updated

Jimmie Johnson won the pole for Sunday's STP Gas Booster 500 after setting a new track qualifying record at Martinsville Speedway.

Johnson, the five-time Sprint Cup Series champion, turned a lap during Friday's qualifying session at 98.400 mph. Tony Stewart held the previous record at this 0.526-mile, paperclip-shaped racetrack at 98.083 mph, which he set in October 2005.

It was Johnson's 30th career pole in NASCAR's premier series, including his third at Martinsville. He started on the pole and won the fall race here last October. Johnson was quickest in practice earlier in the day.

"Track records are hard to come by, so I'm very proud of that and happy to have that," Johnson said. "It was a great day across the board for the team, driver, the engine, the car and everything. We got the car dialed-in."

Johnson and his Hendrick Motorsports teammate, Jeff Gordon, lead all active drivers with seven race wins each at Martinsville.

Marcos Ambrose earned the outside pole with a lap at 98.364 mph. Brian Vickers qualified third, followed by Joey Logano and Kasey Kahne.

"It just feels great to get a front row spot," Ambrose said. "We've had a tough start to our season. I feel good about our race on Sunday. The car has been on a rail since we got here, and it's a nice change."

Gordon, Brad Keselowski, the defending series champion, Matt Kenseth, Carl Edwards and Ryan Newman, who won this race one year ago, completed the top-10.

Kyle Busch will start 11th after winning the most recent race on March 24 at Auto Club Speedway in Fontana, Calif. Dale Earnhardt Jr., the current points leader, will roll off 17th.

Mark Martin qualified 35th in the No. 11 Joe Gibbs Racing Toyota. Martin is substituting for Denny Hamlin in this race after Hamlin suffered a compression fracture in his lower back during an accident on the final lap at Fontana.

"So far I haven't really gotten comfortable yet," Martin said. "It's pretty different, and the way Denny runs here is quite different than my style. We'll have a lot more time tomorrow (in final practice). We're working on getting it to feel like I need it to feel."

Danica Patrick will start 32nd in her first race at Martinsville. Patrick will become the first female to compete in a Sprint Cup event here.

Mike Bliss was the only driver who failed to qualify for the 500-lap race at Martinsville, which is scheduled to start at 1 p.m. ET.