Two spots at Homestead get locked up in a dramatic finish at Texas

Kevin Harvick and Martin Truex Jr. were battling down the stretch at Texas Motor Speedway, and Harvick was simply waiting for Truex to make a mistake in the final 10 laps.

Harvick got his wish when Truex's 78 car got loose in Turn 2, which led to Harvick taking the lead and never looking back for the win.

Related: After winning Stage 2, one driver's day went up in flames at Texas

With the win, Harvick automatically clinched a spot in the championship race at Homestead.

"Damn, it's good to be in victory lane here at Texas," Harvick told NBCSN after the race. "I waited until the end and got (Truex) loose."

Truex finished second, which was enough for him to also clinch a spot in the championship race based off of his lead in the points. It was the second straight week Truex has finished second, and his seven wins are the most of any driver this year.

Truex and Harvick join Kyle Busch as the three drivers who know they will race for the championship at Homestead. The last spot will be up for grabs next week at Phoenix, and it will come down to Denny Hamlin, Brad Keselowski, Chase Elliott, Ryan Blaney and Jimmie Johnson.

Denny Hamlin finished third, followed by Matt Kenseth and Brad Keselowski. Ryan Blaney, Joey Logano, Chase Elliott, Kurt Busch and Erik Jones rounded out the top 10.

Kyle Larson, who is out of the playoffs, won the second stage of the race but crashed in the final stage. Harvick won the first stage.

It was Harvick's first win at Texas Motor Speedway, and he thanked his fans and team after the race.

Now, Harvick can set his sights on securing his second career championship. He'll face stiff competition, but the veteran driver has proven he's capable of coming through in big races.