TALLADEGA, Ala.—Denny Hamlin, winner of three races at Daytona that didn't count, finally has a points-paying victory at a restrictor-plate track.

Hamlin, who opened the season with a pair of wins in Daytona exhibition races only to finish second in the Daytona 500, was again sitting second in the closing laps Sunday at Talladega Superspeedway. But he won a drag race with leader Kevin Harvick on a restart with two laps remaining, and was out front when NASCAR froze the field because of debris from an accident.

Hamlin let out a deep sigh when the yellow flag waved.

“Superspeedway win,” he said on his radio. “With points! With points!”

Hamlin became the eighth winner in 10 races this season as drivers jockey to grab the 16 spots available in the Chase for the Sprint Cup championship. A victory conceivably gives a driver an automatic berth, and Joe Gibbs Racing now has both Hamlin and Kyle Busch eligible for the Chase.

“We really just want to win races, regardless of the implications of what this means for the Chase,” Hamlin said. “I'm still a short-track guy. Those are my roots. But we've come a long way. We couldn't finish 22nd in a restrictor-plate track, now we know we have the cars and the skills to win.”

The win came at the track where Hamlin made a brief return last year—he ran just 23 laps before turning his car over to Brian Vickers—after missing four races with a broken back. Hamlin's return to the car briefly built some momentum for the No. 11 team, but as his back continued to ache, the season fell apart in late summer and it took until the season finale for Hamlin to score his first win of the year. He also missed the Chase for the first time in his career.

It didn't appear that Hamlin had enough to beat Harvick, already a two-time winner this season, until the final restart. Harvick didn't get the help he needed from behind, was hung out without any drafting partners, and Hamlin pulled out to a comfortable lead.

“We were in a good spot there at the end, and what you would want to put yourself in a position to win,” Harvick said. “Our line just never formed up.”

Kyle Larson, who was lined up behind Hamlin on the restart and pushed him past Harvick, wasn't able to help Harvick when Harvick was stranded in a middle lane.

“He got a little bit far out in front of me, and then (Landon Cassill) pulled out of line down the backstretch and I got stuck in the middle and killed our run for the middle lane and the top lane,” Larson said. “I hated that I couldn't help Kevin get a Chevy into Victory Lane.”

As Hamlin pulled away, an accident deep in the pack scattered debris, and NASCAR was forced to throw the caution when a bumper was seen laying on the surface.

The yellow prevented Greg Biffle, who led five times for a race-high 58 laps, from pulling out of line in an attempt to grab the victory away from Hamlin.

“I looked in the mirror and I saw the smoke behind me, and I wasn't really sure whether the caution was going to come out and I didn't know what to do,” Biffle said. “I thought about making my move on (Hamlin) right then because I had a huge run and I could have.

“But I just didn't want to pass too early. I was going to be the lone soldier on the outside lane, and I was going to be 15th by the time we got back around to the start finish line. So I was just waiting. I was setting up to go by him but just never had the chance. I wish I would have known we weren't going to race all the way back.”

Clint Bowyer finished third and was followed by Michael Waltrip Racing teammate Brian Vickers as Toyota took the victory and three of the top four spots.

AJ Allmendinger finished fifth in a Chevrolet, followed by Paul Menard and then Harvick, who faded to seventh. Kasey Kahne, Kyle Larson and Ricky Stenhouse Jr. rounded out the top 10.

Danica Patrick led two times for six laps, and the crowd roared its approval when she drove to the front early in the race. She finished 22nd.

“It was nice to lead laps,” she said. “It made me think real hard about how we're going to stay up front, because we've just got to be there. It was a fast, fast car so we'll be happy to take this one to Daytona.”

It was a rough day for Brad Keselowski, a two-time Talladega winner, who darted to the lead on Lap 14 but appeared to not have cleared Patrick before squeezing in front of her car. She tapped the back of Keselowski's car, sending him for a spin through the grass that caused enough damage to drop him six laps off the pace.

“We weren't clear enough to make that,” crew chief Paul Wolfe told his driver. “I'll just call it at that: We weren't clear enough to make that move.”

Keselowski raced in the heart of the pack after the first incident in an attempt to get his laps back under caution periods. But he was heavily criticized for triggering a 14-car accident with 51 laps remaining. The accident began when Keselowski spun in front of Trevor Bayne, and among those collected were Jeff Gordon, Matt Kenseth, Tony Stewart and Jimmie Johnson.

“Brad made a pretty bold move early, a mind-boggling move, in going in front of Danica and spun out in front of the field and got away with it,” Kenseth said. “This time we weren't so lucky. He was driving really, really, really aggressively to try to get back up there. I'm not sure what the strategy was.

“If it was the other way around and it was anybody else except for him, we'd all be getting lectured.”

Gordon also chastised Keselowski.

“I had seen him for several laps driving over his head being pretty aggressive,” Gordon said. “I knew he was laps down, but he wasn't doing anybody any favors, nor himself. Then, ultimately, that was a wreck.”

Keselowski took the blame for the late accident.

“I just spun out in front of the whole field,” he said. “I don't know why, if I just busted my butt on my own or lost a tire, but I feel bad for everyone that got torn up.”

On the incident with Patrick that put him in position to have to race hard to get his laps back, he said: “Made a really aggressive move to take the lead and then it all just kind of bottlenecked from there. I don't know if I cut somebody off or got ran over, but just enough to get spun out and tear the car up.”