With his series-leading fourth win of the season, Hamlin put himself in position to top the standings when the 12-driver Chase starts after next weekend’s race at Richmond.

Asked if he feels like the driver to beat for the championship, Hamlin replied, “I don’t have to say anything. Wins are all that matters.”

Stafford Township, N.J., native Martin Truex Jr. finished fourth to clinch a spot in the 12-driver Chase for the championship field but fell short of the second Cup victory of his career. His first came at Dover in June 2007, the only previous year in which he earned a spot in the Chase, which is NASCAR’s 10-race version of the playoffs.

Truex led Sunday night’s race with three laps to go but a caution flag prompted a restart and he lost the lead.

“It just wasn’t meant to be again, I guess,” Truex said in an ESPN interview shortly after the race.

Truex had appeared to be positioned for the win until Jamie McMurray smashed into the wall on the front straightaway, bringing out the caution with three laps to go. The leaders went to pit road, and Hamlin’s crew got him back on the track first, just ahead of Truex.

While Truex struggled to get up to speed on the restart, Hamlin pulled away with Gordon right on his bumper.

A four-time Cup champion, Gordon desperately needed a win to bolster his chances of getting into the Chase but couldn’t get by Hamlin on the final lap.

“I wanted this one real bad,” Hamlin said. “The car faded a little bit, but the pit crew won me that race. That’s what a championship team is all about. This year, I think we have it all.”

Gordon was kicking himself for failing to pull off a pass on Hamlin, saying he was too tentative going into turn three. Instead of putting pressure on the leader, the No. 24 car drifted up near the wall going through the high-banked turn while Hamlin pulled away.

Now, Gordon will almost surely have to win at Richmond to claim a wild card.

“I would like to have that one over again,” Gordon said. “I guess I’m getting soft in my old age.”

Brad Keselowski finished third, while Truex faded to fourth. He had struggled all night on restarts, usually needing about five laps to get up to speed. In a desperate bid to stay with Hamlin, he spun his tires when the green flag waved.

“I sure didn’t want to see that caution,” said Truex, who has gone 192 races since his only Cup win. “We had it covered. Such is life. That seems to be my kind of luck when we’re leading.”

Along with Hamlin and Truex, seven other drivers have locked up their spot in the Chase based on points: Greg Biffle, Dale Earnhardt Jr., Matt Kenseth, Jimmie Johnson, Keselowski, Clint Bowyer and Kevin Harvick. Defending Cup champion Tony Stewart, who has three wins this season, is assured of at least a wild card.

Kasey Kahne, with two wins, has all but locked up a spot in the playoff. That leaves a bunch of big-name drivers who know, in all likelihood, they must win at Richmond to have a shot at getting into the Chase — including Gordon, Kyle Busch and last year’s runner-up, Carl Edwards.

It was another tough night for Edwards, who has yet to win a race this season after nearly winning the title in 2011. The No. 99 car started smoking on lap 264, apparently from a blown piston. He was done for the night, a devastating blow to his chances.

Edwards lost last year’s championship to Stewart on a tiebreaker in the final race of the season. Now, he absolutely must win at Richmond — and even that may not be enough to get him into the playoff.

“I’m not a real religious person, but it’s like somebody’s trying to reach me a lesson,” Edwards said. “We’re going to Richmond, where anything can happen. Hopefully whatever happens involves us winning the race and getting in the Chase.”

The race was uneventful most of the night. Busch dominated early on. Then it was Harvick surging to the front, before Hamlin took at extended turn leading the field. At the end, it looked like Truex would make it to victory lane — until that final caution came out.

The first big wreck occurred on lap 269, when Sam Hornish Jr. and Ryan Newman got pinched by Johnson on the backstretch after a restart. Johnson’s No. 48 Chevrolet spun head-first into the wall, leaving Newman with nowhere to go. They were both damaged beyond repair, while Hornish managed to keep going in his banged-up car.