Justin Allgaier held on to the lead in a restart with four laps to go and won the NASCAR Xfinity race in scorching heat, his first victory in five years.

Allgaier, who took four tires on his Kelley-Earnhardt-Miller Chevrolet in one of the late cautions, held off Ryan Blaney and Erik Jones. Blaney, who started the day 33rd after missing the qualifying, pulled ahead of Jones before the final lap to finish second.

Jones and Blaney won the first and second stages of NASCAR’s three-stage format.

There were nine caution flags for 54 laps of the 200-lap race.

The temperature at Phoenix International Raceway in the barren hills southwest of the city was 93 degrees when the race started and 96 by the end.

Elliott Sadler finished fifth and remained the series points leader.

RELATED: Tough NASCAR start for Danica Patrick

MORE: Complete NASCAR weekend coverage

Austin Dillon and his crew chief were summoned to meet with NASCAR officials after he appeared to retaliate by knocking Cole Custer’s car into the wall during the final caution. Custer tapped Dillon’s Toyota into the wall to force the caution initially.

When Custer came around during the caution flag, Dillon ran Custer’s Ford, it’s back end smashed by the earlier collision, into the wall and the yellow flag became a red flag with spilled fuel on the track.

The final restart came with four laps remaining, Allgaier taking his car high into the first turn to hold off Jones’ Toyota. In an earlier restart, Dillon had driven his car low, allowing Jones to take the lead briefly but Allgaier had the fastest car at the end.

Allgaier’s crew replaced all four tires late in the race while Jones’ went with two and it made a difference on the pavement slickened by the fuel.

Allgaier is the first Xfinity series regular driver to win this year in the three races. The first two races were won by NASCAR Cup drivers Kyle Busch and Joey Logano but no Cup veterans competed on Saturday.

The race was a preliminary to Sunday’s NASCAR Cup race.