LOUDON, N.H. – The best car was rolling toward victory — until its driver and crew chief couldn’t agree on how many tires to change.

Kasey Kahne capitalized on that confusion between Denny Hamlin behind the wheel and Darian Grubb in the pits to get his second victory of the year Sunday and make a leap toward one of the 12 spots in the Chase for the Sprint Cup.

“For those guys to miscommunicate, that helped us a ton,” Kahne said. “I’ll take ’em any way we can.”

Hamlin’s Toyota led for 150 of the 301 laps at New Hampshire Motor Speedway. His communication wasn’t quite as good.

Kahne went ahead to stay during a restart on the 240th lap when Hamlin spent extra time in the pits as his crew changed all four tires.

Hamlin wanted just two new ones.

“Darian asked me how much of the tires I felt I’d used up. I felt like I had used up a substantial amount,” he said. “(I said) give me tires and no adjustments. He thought I meant four tires.

“Nothing’s a given. Even though it looked like we had one in the bag if we took two tires, you never know.”

Kahne doesn’t feel he stole a victory.

“I wouldn’t say ‘stolen.’ We ran in the top four the whole race,” he said. “We were in pretty good shape, (but) if he was to keep the track position I never would have passed him.”

Hamlin’s longer pit stop left him all the way back in 13th place, but he kept passing cars until only Kahne remained in front. Then he simply ran out of miles and Kahne won by 2.738 seconds.

It was the 14th win of Kahne’s career. Clint Bowyer, Dale Earnhardt Jr. and Brad Keselowski rounded out the top five.

The victory enhanced Kahne’s chances of qualifying for the Chase. He’s still outside of the top 10 in the points standings, but he moved up from 16th to 12th and is in position to grab one of the two wild-card spots that go to the drivers with the most wins who are ranked 11th to 20th. He’s the only driver outside the top 10 with multiple victories.

“We’ve been pretty tough all year, but we just haven’t finished ’em off a lot of the times,” Kahne said. “From here on out, we need some more top 10s and top fives the rest of the way. It doesn’t get us in the Chase yet, but it does help with a win today.”

The turning point came when the third caution flag flew on the 234th lap for oil dropped on the track by David Reutimann.

Hamlin went into the pit, telling Grubb over the radio that he wanted tires. Grubb, who first planned to change just two, interpreted that to mean four. As Hamlin went back on the track, Grubb told him, “My bad, bud.”

After the race, Grubb took the blame: “That was 100 percent my fault.”

And Hamlin knew how costly the mistake was.

“You try to be optimistic, but you pretty much know your chance of winning has been pretty much taken away if there are no cautions,” he said. “Darian has won me a couple of races this year, more than he’s taken away from me.”

The win was the fifth of the year for Hendrick Motorsports in 19 races. Seven remain before the Chase begins at Chicagoland Speedway in Joliet, Ill., on Sept. 16.

Kyle Busch, the pole-sitter, led the first 66 laps before his own costly pit stop. It took longer than usual as his crew had a problem with the right tire. Then there was more trouble — a drive-through penalty against Busch for entering pit road too fast. When he finally returned to the track, he was all the way back in 22nd place.

Busch quickly got back into contention and even regained the lead briefly a couple times with the help of some good pit strategy by crew chief Dave Rogers. But Busch fell back again when a caution flag came out shortly after he made a pit stop.

“You can’t ask for anything more from a driver to come to a track that historically isn’t one of your favorites and to be that fast, sit on the pole, lead that many laps and be mired in adversity all day long,” Rogers said. “He had every right to get frustrated at the car and he never did. He did a great job of keeping his emotions in check and driving with the talent he has. It just didn’t pay off.”

Busch finished 16th.

With no Sprint Cup race next weekend, Kahne has time to savor his win, no matter how he got it.

“We did it with good pit strategy, got the track positions,” he said, “and we were able to lead those final laps.”