MARTINSVILLE, Va. (AP) — Joey Logano won the pole for Sunday's NASCAR Sprint Cup race at Martinsville Speedway on Friday.

It is the third consecutive pole for Logano on the smallest and oldest track in the premier series. He's the first driver to do that on the 0.526-mile oval since Jeff Gordon won three in a row in 2003-04.

Logano, the fastest in all three rounds of qualifying, barely edged Kasey Kahne with a speed of 97.043 mph while Kahne's best lap was at 97.033 mph. Logano ran five laps in the last session, Kahne ran just three.

"We don't have one of those trophies yet," Logano said in the infield media center, pointing at the grandfather clock that will be awarded to Sunday's winner. "We've figured out the qualifying part really well."

The last time the series visited Martinsville, Logano had perhaps his best chance to win, but a simmering feud with Matt Kenseth boiled over and Kenseth took out Logano while he was leading the race with 46 laps remaining.

The action earned Kenseth a two-race suspension, one of the stiffest in NASCAR history.

Logano said he watched the race Thursday night and went to sleep "not very happy."

"We have a little extra motivation coming up here this week to really show what we're made out of," he said. "It's nice to be able to come up here and do what we know how to do and execute qualifying like we know to."

Brian Vickers will start third in Tony Stewart's Chevrolet, with Paul Menard alongside him, followed by Ryan Newman, AJ Allmendinger, Kyle Busch and defending champion Denny Hamlin, a five-time winner at the track.

Kahne thought he had a chance at the pole, but was pleased to get a front row starting spot.

"I think it gives me a lot of momentum. It gives us some confidence that we can go fast," he said.

___

WHAT TO EXPECT: Jimmie Johnson, an eight-time winner here, qualified 24th. Johnson and Jeff Gordon shared the lead among active drivers with eight victories until Gordon won for a ninth time here last November.

Hamlin's five victories are second most among active drivers.

BACKUP CAR: Trevor Bayne qualified 32nd in a backup car after crashing his primary car in Turns 1 and 2 in the last minute of the day's first practice session.

WELCOME BACK: Ryan Blaney qualified 12th in the Wood Brothers' No. 21 Ford. It's the first time the Wood Brothers are racing at the track about 20 miles from their home since the 2011 season.

LAST MAN IN I: Johnson earned the 24th and final spot in the second round of qualifying, despite Carl Edwards' persistent effort to surpass him. Edwards ran nine laps trying to advance out of the first round.

LAST MAN IN II: Rookie Chase Elliott claimed the 12th and final spot in the third round of qualifying when Kahne made a sizzling late lap to earn the fourth-fastest time, bumping Ricky Stenhouse to 13th place.

THEY SAID IT: "It's such a razor's edge that you're running on." Logano on qualifying at Martinsville.