Stewart-Haas Racing's Kevin Harvick passed reigning champion Martin Truex Jr on the penultimate lap at Kansas to snatch a fifth NASCAR Cup series win of the season.
Polesitter Harvick had battled with Ryan Blaney and Kyle Larson at the front of the field throughout the race, finishing second in both stage one and two and then running third with 31 laps of the 267 remaining.
Three incidents across the next 17 laps then complicated matters at the front of the field.
Larson comfortably led the third stage until the first incident-induced caution of the race was issued as a result of contact between Alex Bowman and Daniel Suarez.
That allowed Harvick to overtake Larson at the restart as Blaney and Larson made contact as the Penske driver tried a move at Turn 1, sending him into the outside wall and into retirement.
Six drivers opted not to stop for fresh tyres during the resultant caution period with 20 laps to go, but Harvick stopped for four tyres and dropped to eighth place.
A red flag was deployed with 14 laps remaining when Hendrick Motorsport's William Byron - who was running in the top 10 after only taking two tyres during the prior caution - slid into SHR's Clint Bowyer on the exit of Turn 4, triggering a crash involving seven drivers.
With nine laps to go and after a final restart, Harvick made use of his fresh tyres and the top lane to scythe through the field.
He reached second place after two laps and caught Truex Jr with three laps remaining, before then passing him on the outside of Turn 4 to take the lead on the penultimate lap.
Truex Jr, who had been running sixth before the flurry of cautions, finished second.
Third-placed Penske driver Joey Logano was another driver who decided not to make a pitstop with 20 laps remaining, subsequently leading the race before being vaulted by Truex Jr on the restart.
Larson ended the day in fourth having been forced to start at the back of the race after his spin in qualifying forced him into a new set of tyres.
He quickly climbed through the pack on fresh rubber, finishing stage one in fifth and winning the second stage.
Joe Gibbs Racing's Denny Hamlin finished fifth, while Paul Menard took advantage of fresh tyres in the final laps to climb to sixth place, after running on the fringes of the top 10 throughout the race.
Erik Jones was third at the final restart but was pinned at the bottom of the track by Logano, losing momentum and track position to take seventh.
Kurt Busch finished eighth, ahead of SHR team-mate Aric Almirola and JGR's Kyle Busch in 10th.
Penske's Brad Keselowski, who finished the opening stage third, ended the race in 14th. He slipped out of contention after making two stops for a loose wheel in the second stage.
|1||Kevin Harvick||Stewart-Haas Racing||Ford|
|2||Martin Truex Jr.||Furniture Row Racing||Toyota|
|3||Joey Logano||Team Penske||Ford|
|4||Kyle Larson||Chip Ganassi Racing||Chevrolet|
|5||Denny Hamlin||Joe Gibbs Racing||Toyota|
|6||Paul Menard||Wood Brothers Racing||Ford|
|7||Erik Jones||Joe Gibbs Racing||Toyota|
|8||Kurt Busch||Stewart-Haas Racing||Ford|
|9||Aric Almirola||Stewart-Haas Racing||Ford|
|10||Kyle Busch||Joe Gibbs Racing||Toyota|
|11||Ricky Stenhouse Jr.||Roush Fenway Racing||Ford|
|12||Chase Elliott||Hendrick Motorsports||Chevrolet|
|13||David Ragan||Front Row Motorsports||Ford|
|14||Brad Keselowski||Team Penske||Ford|
|15||Clint Bowyer||Stewart-Haas Racing||Ford|
|16||A.J. Allmendinger||JTG Daugherty Racing||Chevrolet|
|17||Austin Dillon||Richard Childress Racing||Chevrolet|
|18||Alex Bowman||Hendrick Motorsports||Chevrolet|
|19||Jimmie Johnson||Hendrick Motorsports||Chevrolet|
|20||Michael McDowell||Front Row Motorsports||Ford|
|21||Kasey Kahne||Leavine Family Racing||Chevrolet|
|22||Matt DiBenedetto||Go FAS Racing||Ford|
|23||Darrell Wallace Jr.||Richard Petty Motorsports||Chevrolet|
|24||Corey LaJoie||TriStar Motorsports||Chevrolet|
|25||Landon Cassill||StarCom Racing||Chevrolet|
|26||Ross Chastain||Premium Motorsports||Chevrolet|
|27||Reed Sorenson||Premium Motorsports||Chevrolet|
|28||Daniel Suarez||Joe Gibbs Racing||Toyota|
|29||Gray Gaulding||BK Racing||Toyota|
|30||Ryan Newman||Richard Childress Racing||Chevrolet|
|31||Jamie McMurray||Chip Ganassi Racing||Chevrolet|
|32||Timmy Hill||MBM Motorsports||Toyota|
|33||William Byron||Hendrick Motorsports||Chevrolet|
|34||Chris Buescher||JTG Daugherty Racing||Chevrolet|
|35||B.J. McLeod||Rick Ware Racing||Chevrolet|
|36||Matt Kenseth||Roush Fenway Racing||Ford|
|37||Ryan Blaney||Team Penske||Ford|
|38||Ty Dillon||Germain Racing||Chevrolet|