LOUDON — Defending champion Kevin Harvick fended off a last-second challenge from Denny Hamlin to take the checkered flag in one of the most dramatic Monster Energy Series finishes in the history of New Hampshire Motor Speedway.

Hamlin chased Harvick over the final 20 laps and drew even with one lap remaining. Hamlin missed on an inside move on turn one made his final move on turn four.

Harvick’s No. 4 Busch Beer Ford made contact with Hamlin’s No. 11 FedEx Express Toyota as they entered the final straight. Harvick maintained his composure to beat Hamlin by a .210 hundred of a second, the third smallest margin of victory in 27 Cup races at NHMS.

“For me, I knew he was going to take a shot as soon as he got the opportunity,” said Harvick. “I knew I didn’t need to be in the third lane and I knew he was going to try and go through the middle lane and get me out in the fourth lane with no grip out there.

“I knew going down into the corner he was going to hit me and I survived the hit and I was able to keep the car straight. When you are in that position you have to lay it all out see what happens.

“We were either leaving on a tow truck or winning the race.”

Harvick has won three of the last five Monster Energy Series races on the Magic Mile and fourth overall, equaling the track record set by Jeff Burton, who registered four wins in four years from 1997 to 2000.

With the win, Harvick secured a slot in 16-driver NASCAR playoffs. Hamlin, a three-time winner on the Magic Mile, registered his 15th top 10 finish in 26 races at NHMS.

“This place has been really good to us and I feel like we could have won them all,” said Harvick. “It has been a race track that has been really good from a performance standpoint and from confidence standpoint.”

The outcome was decided by conflicting strategies that came into play when Kyle Larson, operator of the No. 42 McDonalds Chevrolet, hit the wall on lap 264.

Hamlin had led 113 uncontested laps and was in total command of the race when he was called onto pit road by first year crew chief Chris Gabehart to take fuel and two right side tires. Harvick, who was in second at the time, consulted with crew chief Rodney Childers and elected to stay on the track and moved into the top spot for the restart on lap 273.

Hamlin was fourth on the restart on lap 273 and immediately reeled in Joe Gibbs teammates Martin Truex Jr. and Erik Jones to make it a two-car race. Harvick had just enough fuel, tires and staying power to prevail against a worthy opponent.

“The guys that were leading the race, I was really surprised that they pitted,” said Childers. “When we went green with 80 to go, we had already decided if there was another caution we weren’t going to pit.

“When I told him to stay out, I honestly thought we would restart in the first two rows and then everybody pulled in. You just don’t ever know if that is going to work out but I thought we had a good car and the clean air was huge today.”