The win was Busch's first of the season and the 24th of his career, tying him with his brother, 2004 NASCAR Sprint Cup champion Kurt Busch, for 26th all-time.
Tony Stewart, the race leader before the fifth and final caution for debris in Turn 2, lost ground on the restart and finished third. Denny Hamlin ran fourth, followed by Kasey Kahne.
The race turned on the last caution, which Stewart said was called because of a plastic water bottle in Turn 2. Stewart was strong on long runs but uncharacteristically slow off the mark on restarts, and Busch took full advantage.
The first step was beating Stewart off pit road during the final four-tire stop on Lap 388 of 400 and gaining control of the restart.
"I don't know where that last caution came from, but it was our saving grace," Busch said in Victory Lane. "It was a gift. We came down pit road and (crew chief) Dave Rogers and the guys went to work and gave us a great pit stop, got me out front.
"(That) gave me the lead so I could restart the race how I wanted to. That was the win right there."
As he approached the finish line, Busch radioed to his crew: "What up, boys -- we're back!"
It was a stellar weekend for the race winner, who won Friday night's Nationwide Series event as a car owner, with brother Kurt behind the wheel of the Kyle Busch Motorsports Toyota.
Earnhardt, who took over second in the standings -- five points behind series leader and 18th-place finish Greg Biffle -- experienced brake problems for much of the race, but used the late restart to improve his position after Stewart fell back.
"We had some brake problems all race long," Earnhardt explained. "I had a great restart, and I ran really great for one lap, and the pedal went back to the floor. I just had to pump it up all the way down the straightaway and I didn't have any front brakes getting into the corner, so I couldn't get in real hard.
"It would just get loose locking the rears up. So even with the brakes working, I think the No. 18 (Busch) was just a little bit better than us all night."
Slow pit stops cost Stewart track position on more than one occasion, but it was the final caution that proved the undoing of the defending Cup champion, who has three Richmond victories but none since 2002.
"When the caution is for a plastic bottle on the backstretch, it's hard to feel good about losing that one," said Stewart, who led Busch by more than a second when the yellow flag waved. "And we gave it away on pit road. So we did everything we could to throw it away; it got taken away from us.
"That's the best car I've had at Richmond in a long time. So I'm really proud of that and (crew chief) Steve Addington, and I'm proud of our guys. But we've got some work to do on pit stops right now. I don't know what their malfunction was but I'm pretty ticked off about it tonight."
A caution for Jeff Burton's crash into the Turn 3 wall on Lap 311 interrupted a cycle of green-flag pit stops and scrambled the running order.
Jimmie Johnson, who came to pit road when the caution flew, was penalized for a tire violation on his pit stop -- after one of his crewmen rolled a tire unattended toward the pit wall -- and had to restart on Lap 319 from the tail end of the field.
That same restart proved disastrous for Edwards, who was black-flagged for jumping the start after he put the power down, in NASCAR's judgment, before reaching the double red restart lines on the outside wall.
Forced to serve a pass-through penalty, Edwards dropped to 15th, 17 seconds behind Stewart. On lap 372, Stewart put Edwards a lap down and pulled away from Busch in second place to a lead of nearly two seconds.
Johnson rallied to finish sixth, but Edwards, who led a race-high 210 laps, had to settle for 10th, after getting back on the lead lap as the free-pass car under the last caution.
1. (5) Kyle Busch, Toyota, 400, $247,783.
2. (10) Dale Earnhardt Jr., Chevrolet, 400, $164,410.
3. (22) Tony Stewart, Chevrolet, 400, $178,460.
4. (7) Denny Hamlin, Toyota, 400, $152,801.
5. (9) Kasey Kahne, Chevrolet, 400, $113,210.
6. (27) Jimmie Johnson, Chevrolet, 400, $139,121.
7. (23) Clint Bowyer, Toyota, 400, $123,649.
8. (1) Mark Martin, Toyota, 400, $92,360.
9. (16) Brad Keselowski, Dodge, 400, $120,880.
10. (2) Carl Edwards, Ford, 400, $138,551.
11. (24) Matt Kenseth, Ford, 400, $127,121.
12. (20) Juan Pablo Montoya, Chevrolet, 400, $110,726.
13. (31) Paul Menard, Chevrolet, 400, $88,110.
14. (37) Jamie McMurray, Chevrolet, 400, $114,368.
15. (12) Ryan Newman, Chevrolet, 400, $118,693.
16. (4) AJ Allmendinger, Dodge, 400, $117,860.
17. (19) Bobby Labonte, Toyota, 400, $102,768.
18. (28) Greg Biffle, Ford, 400, $83,885.
19. (3) Kevin Harvick, Chevrolet, 400, $120,896.
20. (21) Landon Cassill, Toyota, 399, $103,055.
21. (26) Casey Mears, Ford, 399, $91,418.
22. (14) Marcos Ambrose, Ford, 399, $102,893.
23. (6) Jeff Gordon, Chevrolet, 399, $119,221.
24. (18) Joey Logano, Toyota, 399, $82,535.
25. (8) Martin Truex Jr., Toyota, 399, $102,024.
26. (11) Aric Almirola, Ford, 398, $110,996.
27. (15) Regan Smith, Chevrolet, 398, $95,968.
28. (13) Kurt Busch, Chevrolet, 397, $93,243.
29. (17) Dave Blaney, Chevrolet, 397, $70,460.
30. (29) Travis Kvapil, Toyota, 397, $92,332.
31. (30) Jeff Burton, Chevrolet, 396, $112,235.
32. (38) David Ragan, Ford, 394, $72,510.
33. (33) David Reutimann, Chevrolet, 394, $69,885.
34. (42) Reed Sorenson, Ford, 392, $77,760.
35. (40) Stephen Leicht, Chevrolet, 391, $77,635.
36. (41) David Gilliland, Ford, 355, $69,485.
37. (34) David Stremme, Toyota, Brakes, 139, $69,355.
38. (32) Josh Wise, Ford, Accident, 127, $70,703.
39. (25) Michael McDowell, Ford, Brakes, 67, $66,325.
40. (43) Cole Whitt, Chevrolet, Vibration, 29, $66,200.
41. (35) Joe Nemechek, Toyota, Brakes, 28, $66,050.
42. (39) Mike Bliss, Toyota, Rear Gear, 23, $65,925.
43. (36) Scott Speed, Ford, Electrical, 19, $66,293.