Carl Edwards took the lead on the last pit stop and held off Denny Hamlin on a restart eight laps from the end for his first Southern 500 victory Sunday night.

Edwards was two laps behind early in the long, long, nearly five-hour NASCAR Sprint Cup race, slowed by a record 18 cautions at Darlington Raceway.

Pole-sitter Brad Keselowski was second and Hamlin finished third. Joey Logano was fourth, followed by defending race champion Kevin Harvick and the Busch brothers, Kurt and Kyle.

Edwards won for the second time this season, and gave Joe Gibbs Racing its seventh victory in the last 10 events. JGR swept the weekend, with Hamlin winning the Xfinity race Saturday.

Edwards did his signature victory backflip in the race's return to Labor Day weekend.

© 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.