TALLADEGA -- Denny Hamlin was never happier to see a caution flag fly than he was in the final mile of the Aaron’s 499 at Talladega Superspeedway.

It has been a tough 12 months or so for the 33-year-old Virginian, but he collected a much-needed win Sunday when he held off Kevin Harvick, Greg Biffle and Clint Bowyer in what amounted to a two-lap sprint for his 24th career Sprint Cup victory in his 300th career Cup start.

It was the first win in a restrictor-plate points race for a driver whose roots lie in the short tracks. The victory virtually assured Hamlin of a spot in The Chase for The Cup, the top racing series’ late-season playoff race he missed last year for the first time in his career.

“This is a good momentum for us, it definitely is,” Hamlin said. “We’ve kind of missed out on some opportunities to have good finishes over the last month or so. I was really looking forward to California and didn’t get to run that event (illness). We’ve had some bad luck between Darlington and Richmond and Texas. I made some pretty bad mistakes two weeks in a row and then last week getting wrecked at the very end.

“Those are momentum crushers. Those things can really bug you. … I was responsible for some of that and kind of take responsibility for it, so a win like this kind of makes you forget all those things and obviously gives you a clean slate for the rest of the summer to start over.”

The race ended under caution as the result of a multi-car incident some 500 yards behind the leaders after Hamlin had taken the white flag.

NASCAR strives to finish its races under green, but officials froze the field midway through the final lap when they determined a piece of debris sitting just beyond the start-finish line presented too much of a hazard for a safe finish. It was the third caution in the final 14 laps.

On the final restart, Hamlin and Harvick started side-by-side, with Biffle and Kyle Larson right on their bumpers. Hamlin pulled out in front of Biffle as Harvick lost his line and kept his position to the finish. He was holding strong when an incident behind them left a piece of Justin Allgaier’s bumper lying a few yards beyond where they had to get to.

Biffle ended up second and Bowyer was third. Harvick wound up seventh. Larson finished ninth. Biffle led the most laps among 23 race leaders. Dale Earnhardt Jr. led 26 laps, but finished 26th after falling back late in the race. Jeff Gordon finished 39th, but maintained a three-point lead over Matt Kenseth in the points race as the series heads to Kansas.

Hamlin was confident even without the caution he was in a good position to win.

“I knew once we got single file on the bottom. … I was in really good shape,” he said. “I knew from Daytona you wanted to be our front. I would much rather be on the defensive than I would the offensive in the last few laps situation.

“My goal was to get to the white flag. (The spotters) said they were spinning right as I crossed the line. I said, no problem, I hope it jams the racetrack up for all I care and throw the caution immediately. They knew there was debris at the start-finish line, so we weren’t going to be able to race all the way back no matter what, but they at least gave everyone a half a lap to do whatever you could. Whether we had to go to the line or not, we were in pretty good shape.”

None of the contenders really knew what to make of what was unfolding behind them. Biffle and Bowyer both were lining up to make a final move, but worried about going too soon and getting shuffled back in the pack. They never got a chance to pull any trigger before the caution was raised.

“I was trying to make a decision to go or not, then I decided to wait,” Biffle said. “I figured once we got in the middle of (turns) 1 and 2 if the caution wasn’t out, it wasn’t going to come out and we’re good all the way back.

“When I got back around I was wondering why nobody told me there was a half a car laying in the track (and) we probably aren’t going to race back so go ahead and try and pass him now. But that’s a lot to happen in a short amount of time.”

Bowyer defended NASCAR’s decision to wait before pulling the caution.

“It was frustrating because we both thought we had an opportunity to pounce and make a move for the win … but NASCAR did the right thing,” he said. “You can’t put people in danger right there. If there’s another green-white-checkered everybody would have been out of gas. It’s just too much going on right there.”

There were actually three cautions in the final 14 laps.

With 14 laps to go, six-time champion Jimmie Johnson got loose in just about the same spot Brad Keselowski set off a chain reaction incident some 30 laps earlier. He nearly got into Ricky Stenhouse Jr., then shot up to the wall where four other cars, including Joey Logano, Kurt Busch and defending race winner David Ragan collected along the wall. Johnson, looking for his first win of the year, rode off with cosmetic damage, but Logano and Busch were done.

They restarted with 10 left, but two laps later it bottled back up again when Carl Edwards lost a tire in the middle of a pack in Turn 1 and got tagged by Ryan Newman.

There was a lot of tight but relatively clean racing when the first shuffle came in Lap 137. Keselowski, back on the track six laps down after an early dust-up with Danica Patrick, got loose alongside Dale Earnhardt in Turn 4 and immediately collected five cars along the outside wall and ultimately involved 14.

Among those caught up in what qualified as The Big One at the time were pole-sitter Brian Scott, Gordon, Kenseth, Johnson and Tony Stewart.

“I don’t know if I ran over something or just busted by rear end, but I feel bad for the guys who got caught up in it,” Keselowski said. “We were just trying really hard to get a lap back there and couldn’t catch any yellows or any breaks, so I had to be really aggressive and hope for something to happen our way.”

Keselowski fell behind 14 laps into the race when the leaders got into it with what Kenseth called a “pretty bold, mind-boggling” move to get in front of Patrick, but it looked a lot wilder than it presented.

The field was racing three-wide throughout the early going. Keselowski slid into the middle and tried to pass Patrick, but he didn’t get out quite far enough. Patrick caught the White Deuce on its left rear, sending it sliding down into the infield. He saved the car and shot back up onto the track, where he barely missed Trevor Bayne.

Keselowski’s car sustained radiator damage in the incident and had to come off the track for six laps.

Fifteen laps later, Patrick was fighting to stay in the top 20 and continued moving backwards, reporting the car running warm whenever she got in traffic. She wound up finishing 22nd.

Al Muskewitz is a sports writer for The Star. He can be reached at 256-235-3577.