LOUDON, N.H. — For the first 13 years of his NASCAR Sprint Cup Series career, Matt Kenseth had Loudon, N.H., not ranked very high on his list of happy locales to visit for events.

In 26 starts for Roush Fenway Racing from 2000 to 2012, Kenseth had no victories and only five top-five finishes and 12 top-10 finishes at New Hampshire Motor Speedway.

But these days the cozy confines of the tight 1.058-mile Loudon oval regularly put a smile on the face of Kenseth, who joined the Joe Gibbs Racing stable before the 2013 season.

On Sunday, Kenseth proved once again that the horrors at the New Hampshire Motor Speedway are long in the rear view.

Kenseth rallied from a deep starting spot and rolled to victory in the Sprint Cup Series New Hampshire 301.

“It always feels good to win, but today especially,” Kenseth said. “Friday I didn't do a good job qualifying. We had to start in the middle of the pack. Our first run wasn't great, we adjusted and made some great changes for run two and really I felt like we had probably the best car all day, it just took forever to get there. It definitely feels good to get the win.”

Tony Stewart was second and Joey Logano third.

It was the second consecutive victory at the track for Kenseth — who won there last September in the second Chase for the Championship playoff event — and his third victory overall in his past six starts in Loudon.

In seven races at Loudon since moving to Joe Gibbs Racing, Kenseth has an average finish of 6.1 at New Hampshire Motor Speedway and has finished sixth or better five times, with only one finish worse than ninth.

“I was looking forward to coming here because we've ran really well here since I've came to Joe Gibbs Racing,” Kenseth said. “It's been a real turnaround for me. This used to be one of my worst places and now I feel like it's one of my better places.”

Said crew chief Jason Ratcliff: “It seems like this is one of our better tracks. We've had some good runs here in the last three years and we always look forward to coming here. It's been a track that's not only good for the team, but obviously good for Matt.”

For Joe Gibbs Racing it proved an important victory. The team had gone six events without winning, which stood out as a huge number considering Joe Gibbs Racing cars won seven of the first 12 events of the season. The last win for the team was Kenseth's on May 15 at Dover International Speedway. Kyle Busch (three wins), Carl Edwards (two wins) and Denny Hamlin (one win) have the team's other victories this year.

“Now I'm thinking about going and trying to win the Brickyard,” Kenseth said of the next event on the schedule, at Indianapolis Motor Speedway. “It's been an up-and-down couple months, for sure. But last week I felt like if all the stars were aligned we could have won at [Kentucky Motor Speedway], if everything went just for right for us. To be able to come here and win obviously feels good. I'm just thinking about moving on to [Indianapolis] and hopefully being in the mix.”

Kenseth started 18th in the field. He was up to fifth by Lap 75. He went by Martin Truex Jr. for the lead on Lap 258 and held that spot until a round of pit stops under caution. Hamlin stayed out and assumed the lead, but Kenseth retook the lead for good on Lap 271.

Busch led the most laps (133) Sunday, but faded to eighth place late. Hamlin led five laps and was ninth. Edwards was 20th. All four Gibbs teams are already unofficially qualified for the Chase for the Championship playoff.

“That's what it's all about,” team owner Joe Gibbs said. “… I think the key is, as you continue to work during the year, is trying to keep the performance and try to point to the playoffs. When you get to the playoffs you never know what's going to happen. You take your best shot. What you want to do is hopefully continue to improve as the year goes on and that's kind of our goal.”

More than an hour after the conclusion of the race, NASCAR officials announced that Kenseth's car failed the postrace Laser Inspection System and will be further examined this week at the NASCAR R&D Center in Concord, N.C.