LOUDON, N.H. — Joe Gibbs Racing has undergone an unexpected upheaval that forced the organization into a youth movement.

The biggest surprise, though, was going 0 for 2017.

Denny Hamlin ended that rut with the kind of finish down the stretch that showed that — yes, the new generation may be on the way — but the JGR lynchpin still knows how to win.

Hamlin held off Kyle Larson over the final laps Sunday at New Hampshire Motor Speedway to send Gibbs to its first victory of the season.

One of the top organizations in NASCAR, JGR had yet to have any of its four drivers win until Hamlin took the lead with 33 laps left and held off the hard-charging Larson on the final lap.

Hamlin needed his 30th career Cup victory to secure a berth in NASCAR's version of the post-season and end a winless streak that stretched to last September at Richmond.

"Definitely needed a win for the organization, for myself," Hamlin said.

He'll take the checkered flag — just hold the nutcracker.

Hamlin, who has a Cup win in each of his 12 seasons, gave everyone a laugh when he scampered away from the lobster traditionally awarded to the winner in victory lane.

"I have a lobster phobia," he said.

Larson had a sensational run from the rear of the field, where he was forced to start because he failed inspection after he won the pole. Larson lost his points lead last week and his crew chief was suspended after failing a post-race inspection at Kentucky.

Hamlin crashed the No. 11 Toyota in practice and was forced to race in a backup car. It seemed to suit him just fine at New Hampshire.

Martin Truex Jr., was third, followed by Matt Kenseth and Kevin Harvick.

JGR won seven of the first 12 races last season and Carl Edwards was 10 laps away from a possible championship when he crashed out in the finale. Daniel Suarez replaced Edwards this season, and Hamlin, Kenseth and Kyle Busch have made strong runs at the checkered flag, they just couldn't find the winning formula until New Hampshire.

"It's not from a lack of trying," Hamlin said.

JGR also announced this week that Erik Jones would replace two-time Daytona 500 champion Kenseth in the No. 20 next season. With Hamlin sending the crowd into a frenzy by burning the tires down, Sunday was simply a reason for the organization to celebrate.

Jones and Suarez will soon be expected to carry the load into the next decade once Busch and the 36-year-old Hamlin finish their careers.

"They're going to be there long after I'm gone," Hamlin said. "They'll be the team leaders. You just try and set an example for them. Show the work ethic that it takes to be a winner on a weekly basis. Hopefully, that infectious-type atmosphere bleeds into them and they lead the team after we're gone."

Larson was second and nearly caught Hamlin — after a trying week where NASCAR caught Larson's Chip Ganassi team trying to tinker a bit too much outside the rule book on the No. 42 Chevrolet.

Larson's team was penalized 35 points this week, erasing what had been a one-point advantage over Truex in the driver standings. Truex, who led 137 laps, leads the standings by 38 points over Larson.

Larson's pole-winning time was disallowed because of an unapproved rear deck fin lid.

"NASCAR's kept a closer eye on our team, in particular," Larson said. "Had to go to the back. I don't think that really affected us which I think is a good thing. The little stuff we got in trouble for so far hasn't affected our performance. We've got to keep working hard on the areas on our race car that are legal and find more speed that way."

Here are other items of note from New Hampshire:

LOGANO OUT:

Joey Logano's miserable stretch continued on his home track. Logano, who needs a win or a string of strong finishes to make NASCAR's playoffs, was forced off the track on the third stage because of a suspension issue. NASCAR seized a rear suspension part with the No. 22 Ford in the garage. He finished 37th.

The Connecticut driver reeled off six top-five finishes in the first nine races that included a win at Richmond. The win did not count toward the playoffs because of rules violations. Logano has posted just two top-10 finishes over the last 10 races and this was the fifth time he finished 25th or worse.

TRACK CRACK

The race was stopped for 5 1/2 minutes when a pot hole opened on the track. The hole was discovered just before the second stage and crews hit the scene to make repairs.

ALMIROLA'S RETURN

Aric Almirola finished 24th in his first race since he suffered a fractured vertebra during a fiery multi-car wreck May 13 at Kanas Speedway.

UP NEXT

Kyle Busch heads to Indianapolis to try and win his third straight Brickyard 400 championship. Busch has not won a Cup race since he kissed the bricks at Indy.

___

More AP auto racing: http://racing.ap.org