AVONDALE, Ariz. — Justin Allgaier, William Byron, Elliott Sadler and Daniel Hemric took the four spots next week in the Xfinity Series championship race.

All four berths in the championship were on the line Saturday at Phoenix Raceway, where Byron raced to his fourth victory of the season. The other three drivers made it into the Homestead-Miami finale on points.

It made for an enjoyable race for the final spot between Hemric and Cole Custer, as the two battled for position in the closing laps. Custer was fourth and Hemric fifth, and if they stayed that way, Hemric had the spot. But Christopher Bell chased Hemric, who couldn’t afford to give up a position between Custer.

Bell used a three-wide pass on the outside to get by both drivers, and Hemric eventually passed Custer and finished fifth.

The finale will be all Chevrolet drivers, and three from JR Motorsports.

NASCAR: Kevin Harvick led the final two practice sessions before Sunday’s playoff race at Phoenix Raceway.

Harvick is an eight-time winner at Phoenix. He’s already clinched a spot in next week’s championship race, so he does not need to win Sunday to make it to the finale at Homestead-Miami Speedway.

Kyle Busch was second fastest, and he has also already locked in to the finale.

Martin Truex Jr. was fourth fastest, and he’s got the third spot in the championship race.

Sixth fastest was Jimmie Johnson, who is ranked last in the eight-driver field and needs to win Sunday to defend his Cup championship.

Denny Hamlin and Brad Keselowski were eighth and ninth fastest. Pole-sitter Ryan Blaney was 10th.

Chase Elliott was the slowest playoff driver at 17th.

There are five drivers vying for one position in the finale during Sunday’s race. Keselowski can make it in on points, while the others likely need to win the race.

FORMULA ONE: Valtteri Bottas claimed pole position for the Brazilian Grand Prix from a qualifying session in which Mercedes teammate Lewis Hamilton crashed on the first lap o at Sao Paolo.

Hamilton, who won his fourth Formula One championship two weeks ago in Mexico, walked away from the car without injury and will start at the back of the grid on Sunday.