AVONDALE, Ariz. (AP)Ty Gibbs took the lead with 21 laps left and held off rival Noah Gragson for his first NASCAR Xfinity Series championship at Phoenix Raceway on Saturday night.

The only non-JR Motorsports driver in the winner-take-all finale, Gibbs started on the pole at the 1-mile oval and stayed near the front in changing conditions all evening.

The emotional, aggressive driver kept his cool after wrecking teammate Brandon Jones out of the lead last week in Martinsville to take an Xfinity championship with him to the Cup Series next year.

Gibbs ducked his No. 54 Toyota under Justin Allgaier shortly after a restart and stretched his lead until Gragson pulled within a couple of car lengths late. The 20-year-old grandson of Hall of Famer and team owner Joe Gibbs kept Gragson at bay and crossed the checkered flag for an emotional victory.

Gragson finished second, Allgaier third and Josh Berry took fourth in the championship round after finishing 13th on Saturday.

Gibbs was the wild card in the finale four after ruffling a few fenders in his second Xfinity season. Gibbs got in a fistfight with Sam Mayer after an Xfinity race and NASCAR fined him $75,000 for a Cup Series pit road incident that nearly sent Ty Dillon’s car into personnel.

Gibbs took his aggressiveness to a new level last week, wrecking Jones out of the lead and the championship round in the third overtime at Martinsville Raceway.

Gibbs was remorseful in the build-up to the Xfinity finale, saying he hoped he learned from his mistakes. He certainly seemed to, driving aggressively, but not carelessly, to win a title for himself and his grandfather.

The 24-year-old Gragson was near the lead most of the evening until a slow pit stop dropped him to eighth with 40 laps to go. He had been one of Gibbs’ biggest critics after being wrecked by him in the past, saying he would retaliate if given the chance.

Gragson never got it, rallying to take second in his last Xfinity start before heading to the Cup Series with Petty GMS next year.

The 36-year-old Allgaier had his best chance to win his first Xfinity title, keeping his No. 8 Chevy running up front all race. He lost momentum when he tried to go high and got passed by Gibbs, adding a third to the second he took in the 2020 Xfinity playoffs

Berry had to fight his way back after a slow early pit stop dropped him to 15th, and was third on the restart with 30 laps to go. He tried to go high around the first turn, wobbled and bounced off the wall, dropping to 23rd in his first Xfinity playoffs.

AP auto racing: https://apnews.com/hub/auto-racing and https://twitter.com/AP-Sports