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 11th 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-time champion.
Kyle Busch was among a number of drivers taking four new tires 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.