RICHMOND, Va. (AP) — Dale Earnhardt Jr. dominated all day and regained the lead on a late restart to win the NASCAR Xfinity Series race at Richmond International Raceway on Saturday, earning his 24th career victory in the series and first in more than six years.

It also was the first time he's ever won in one of his own cars, which he said "makes it a little better."

The victory capped off a lucrative few days for JR Motorsports. Earnhardt said Unilever, the maker of Hellmann's mayonnaise and a team partner since 2009, has signed on to sponsor the team's Xfinity cars for 20 races in 2017-18.

"To be able to come and win a race in that car is incredible," Earnhardt said about the car that bore the Hellmann's colors.

It was his fourth series win at Richmond.

Earnhardt built a lead of more than 5 seconds as the first 125 laps were run caution-free. When a caution finally flew with 15 laps to go, he and the other 10 cars on the lead lap headed for the pits, and chaos ensued, causing the race to go nine extra laps.

Earnhardt led 128 laps but was beaten off pit road by his JR Motorsports teammate Justin Allgaier, one of four drivers contending for a $100,000 bonus. But Brennan Poole, another contender for the bonus, stayed on the track on old tires, and when Earnhardt dove underneath him heading into Turn 1, Poole's car nudged the back of Allgaier's, sending him spinning out of the race.

That opened a door for Earnhardt to get back in front and for Ty Dillon to hold on for second and claim the $100,000 bonus in overtime.

"I don't run the Xfinity Series but a couple of times a year, so the opportunities to win are few and far between," Earnhardt said. His last victory in the series came at Daytona in 2010.

Dillon said he thought he might have a chance in the two-lap spring to the finish, but came up short.

"They were just too fast today," Dillon said. "We were right there. They just had us by a little bit."

Dillon said when the race went back to green, his thoughts were on winning the race, not the bonus.

"It was all about the W," he said. "Really I wasn't really worried about anything but trying to win."

With the boss leading the way, the day was also a success for Earnhardt's team with Elliott Sadler finishing third and Cole Custer sixth in his first start in the Xfinity Series. After the accident deprived him of a chance for the bonus, Allgaier finished 35th.

Series points leader Daniel Suarez finished fourth, followed by Austin Dillon.

Saurez leads Sadler by nine points in the series standings after eight races.