Denny Hamlin beat Jimmie Johnson to put and end to the reigning champion's winning streak at Martinsville.
The Joe Gibbs Racing driver emerged as the dominant force in the second half of the race after Johnson looked in control for the first 250 laps.
In the race's longest green-flag run, following the eleventh of 14 caution periods, Hamlin started to close on Johnson until he went by him on lap 363.
The race carried on without incident until the leaders were forced to make a last stop under green. The order remained the same after all the leaders completed their final four-tyre changes, but a further caution would finally bunch up the field again.
Three more restarts would follow, but Hamlin stayed in control in the green-white-chequered finish to claim his third win of the season.
Johnson finished second but still extended his lead in the points to Mark Martin, while Juan Pablo Montoya kept the reigning champion on his toes in the final two laps.
Montoya led the race for 37 laps in the first half, overtaking Johnson on lap 141. He was often beaten in the pits however, and from fourth on the penultimate restart he overtook Gordon for third place driving on his outside - not the usual line to overtake at Martinsville.
Gordon lost to Kyle Busch on the final restart and eventually finished fifth. The Hendrick driver made a great recovery after losing ground halfway through the race, having led early on after starting from the front row.
He also had a couple of exchanges with Montoya during the race while battling for position but in their final battle they gave each other room, the Colombian eventually beating the four-times champion.
Kyle Busch was among a number of drivers taking four new tyres during the penultimate caution, while most stayed out to keep track position. Jamie McMurray made the same strategy work for him as he finished sixth, while Mark Martin didn't gain much from a similar move, finishing eighth.
The veteran has lost more ground in the title battle to Johnson, and he trails him now by 118 points heading into the "wildcard" race of the Chase at Talladega.
Pos Driver Car 1. Denny Hamlin Toyota 2. Jimmie Johnson Chevrolet 3. Juan Pablo Montoya Chevrolet 4. Kyle Busch Toyota 5. Jeff Gordon Chevrolet 6. Jamie McMurray Ford 7. Ryan Newman Chevrolet 8. Mark Martin Chevrolet 9. Tony Stewart Chevrolet 10. Kevin Harvick Chevrolet 11. Brian Vickers Toyota 12. Joey Logano Toyota 13. Bobby Labonte Ford 14. Matt Kenseth Ford 15. Jeff Burton Chevrolet 16. David Reutimann Toyota 17. Kurt Busch Dodge 18. Casey Mears Chevrolet 19. Clint Bowyer Chevrolet 20. Carl Edwards Ford 21. Elliott Sadler Dodge 22. David Ragan Ford 23. Paul Menard Ford 24. Reed Sorenson Dodge 25. Greg Biffle Ford 26. John Andretti Chevrolet 27. Marcos Ambrose Toyota 28. Martin Truex Jr. Chevrolet 29. Dale Earnhardt Jr. Chevrolet 30. Michael Waltrip Toyota 31. Scott Speed Toyota 32. Kasey Kahne Dodge 33. David Stremme Dodge 34. AJ Allmendinger Dodge 35. Sterling Marlin Dodge 36. Sam Hornish Jr. Dodge 37. Robby Gordon Toyota 38. Joe Nemechek Toyota 39. David Gilliland Chevrolet 40. Dave Blaney Toyota 41. Michael McDowell Toyota 42. Derrike Cope Toyota 43. Travis Kvapil Dodge