BRISTOL, Tenn. — A week after finishing second to Matt Kenseth, Kasey Kahne won a spectacular duel with champion Brad Keselowski Sunday to win a Food City 500 marred by a postrace scuffle.

Kahne survived a wild, bumper-banging battle for the lead with Keselowski and then sped away on the final restart with 39 laps to go to win for the first time at Bristol.

Denny Hamlin and Joey Logano, meanwhile, tangled on pit road after the race after Hamlin wrecked Logano during a battle for the lead. Hamlin spun Logano on Lap 390 and Logano went after Hamlin after the race and had to be restrained by Hamlin's crew.

"He said he was coming for me," Hamlin said when asked what Logano said to him after sticking his head in Hamlin's car.

"It was frustrating," said Logano, who declined to reveal what he said to Hamlin, his former teammate, when he approached him after the race.

After losing the lead to Kahne, Keselowski engaged in a thrilling battle for second with Kyle Busch. Busch held on to the spot while Keselowski finished third followed by Kurt Busch and Clint Bowyer.

Hamlin, who led much of the race, banged the wall multiple times in the last few laps, losing two laps and finishing 23rd. Logano wound up 17th.

Keselowski, who won this race last year, took the lead for the first time by staying on the track while the rest of the leaders pitted on Lap 397. He held the lead on the restart and engaged Kahne in a fabulous battle for the lead with NASCAR's new Sprint Cup car.

Kahne ran him down and had a much faster car, but could not get around Keselowski, who blocked him high and low, with Kahne at times hitting his rear bumper.

Kahne finally swept to Keselowski's outside to take the lead on Lap 446. But he held it for just two laps before he got trapped behind a lapped car and Keselowski dove to his inside to move back out front.

Kahne then almost wrecked, nearly spinning on the backstretch before regaining control of his car. He was holding off a fast-closing Hamlin and Kyle Busch when Jimmie Johnson blew a tire and hit the wall, bringing out a caution flag with 44 laps remaining.

Keselowski got off to a slow start on the ensuing restart and Kahne sped away to lead the final 39 laps.

"This is a big win," Kahne said. "I love racing for Hendrick Motorsports, Rick Hendrick and the opportunity he gives up. This whole team was flawless again today. Last week, today and the whole season so far."

Kahne led the most laps last week at Las Vegas Motor Speedway, but finished second to Kenseth, who was in contention again at Bristol before getting into a wreck during his own battle for the lead.

The win was the 15th of Kahne's career and his third with Hendrick after a two-win 2012 season.

"Racing Brad and racing Denny was tough and Matt Kenseth was really good," Kahne said. "It was a big win for us.

"This has been a tough track for me at times. For this whole team to step up and get it together, we’ve prepared pretty hard this year and it feels good to win."

Hamlin led a race-high 117 laps while Kahne led 109 and Kenseth 85.

The race was shaping up to be a battle between Kenseth and Jeff Gordon, two former champions, until they wound up with demolished cars after a spectacular crash.

Kenseth, who had led earlier, was running down Gordon and about to challenge him for the lead when Gordon had a right-front tire blow. As his car veered toward the wall, Kenseth's car slammed into the rear of the No. 24, briefly lifting it off the ground.

Before climbing from his car, Gordon asked his crew if he had taken out Kenseth. When told that he had, Gordon said, "Sucks. Sorry, boys."

"I really hate we collected Matt Kenseth," said Gordon, who was trying to hold onto the lead after changing just two tires on his previous pit stop. "He had a great car and he was coming."

Kenseth also wrecked while battling for the lead at Bristol last August, crashing with Tony Stewart in an incident that ended with Stewart flinging his helmet at Kenseth's car.

"We had a great car," Kenseth said, "there was just nowhere to go (when Gordon crashed)."

Logano also found the wall while battling Gordon for the lead. He tried for several laps to pass Gordon but could not get around him in the inside lane. After drifting high, Hamlin tapped him from behind on the frontstretch and then hit him again, causing Logano to spin and crash on the backstretch.

Logano, who finished 17th, was not happy with his former Joe Gibbs Racing teammate after the race. Gibbs replaced Logano with Kenseth after the 2012 season and Logano is Keselowski's teammate at Penske Racing.

"He slid up into me," Hamlin said. "I checked up twice. I didn't mean to run into him."

Hamlin said the incident had nothing to do with the two drivers exchanging barbs on Twitter following the Daytona 500.

Asked about the relationship between Hamlin and their former Gibbs teammate, Kyle Busch said, "It's a little disheartening that we all can't just get along."

The Gibbs cars dominated the first half of the race with Busch, the polesitter, leading the first 55 laps before getting nabbed for speeding on pit road.

Hamlin then took over and led 117 of the next 134 laps. Kahne then took a turn at the front until Kenseth took over and led the next 85 laps.

The race featured three early wrecks with Stewart, Jeff Burton and Jamie McMurray all finding the wall in the first 72 laps. Stewart blew a tire after making contact with another driver and wrecked on Lap 9. Burton had to check up when two cars in front of him got together and Carl Edwards hit him from behind.