AP photo by Steve Helbert / Martin Truex Jr. crosses the finish line to win Saturday night's NASCAR Cup Series race in Richmond, Va.

RICHMOND, Va. — Martin Truex Jr. took the lead when Joe Gibbs Racing teammate Kyle Busch was penalized for speeding with about 50 laps to go Saturday night at Richmond Raceway, and Truex held on to win for the third time in the past five NASCAR Cup Series races at the 3/4-mile track.

He moved to the front when Busch was caught speeding entering pit road during green flag pit stops, causing him to relinquish a big lead and fall back to 10th. Even with Busch's trouble, Truex led a 1-2-3 finish for JGR — the sixth in its history — with Denny Hamlin finishing second and Christopher Bell third.

Truex won despite being black-flagged on the first lap for beating Hamlin, who began in pole position, to the start-finish line as the field went green.

"That was frustrating, I'm not going to lie, but I knew we had a good enough car to overcome it," Truex said about the penalty.

His JGR No. 19 Toyota bore a red, white and blue paint scheme as part of the day-long tribute to honor the victims and heroes of the 9/11 terrorist attacks 20 years ago.

"It's an important day in our history, and I think all of us here — yeah, we're proud to win and this car's amazing and there's so many people to thank, but what a day to win on," Truex said in victory lane. "It reminds you of the honor it is and the privilege it is to get to come out here and do this."

Fans were given small American flags as they entered the track and were encouraged to stand and wave them as a fire truck and two police SUVs, all with lights flashing, led the pace vehicles on the parade laps ahead of the race.

As the tribute unfolded, a chant of "USA! USA!" erupted in the stands.

At the race's end, Hamlin trimmed an eight-second deficit to 1.4 but ran out of time.

"We needed just a couple more laps. That's all," said Hamlin, who was coming off his first win of the season in last Sunday's Southern 500 at South Carolina's Darlington Raceway.

Bell has three NASCAR Xfinity Series wins at Richmond but none on the top circuit. This is the 26-year-old's second Cup Series season, and he was fourth at the Virginia track in April.

"We knew going into Richmond that this is one of our better race tracks, so we needed to capitalize on that and get all the points we could," he said.

Truex's penalty sent him to the back of the field, but as he has done repeatedly since ending an 80-race winless drought on tracks shorter than a mile at the start of his career, he masterfully worked his way back into contention. The victory was his fourth of the season and the 31st of his career.

Reigning series champion Chase Elliott was fourth for Hendrick Motorsports, followed by Team Penske's Joey Logano and Hendrick's Kyle Larson, who leads the points standings but started the race at the back of the field after twice failing inspection before the race. Larson finished sixth and clinched a spot in the second round of the playoffs.

The 16-driver field for the postseason will be cut to 12 after next Saturday night's race on another short track, Tennessee's Bristol Motor Speedway.

Hamlin, as he did in the spring race at Richmond, won both of the first two stages and led the most laps — 207 in April, 197 on Saturday — but failed to follow his victory last weekend with another on the track about 20 miles from where he grew up.

He cut 10 points off Larson's lead — from 34 to 24 — with Truex another 14 points back. They are the only three to have clinched spots in the next round.

"So very good to be able to do this and go to Bristol without any worries next week," Truex said.

Things aren't going so well for William Byron and Michael McDowell.

Byron was 34th at Darlington and 19th at Richmond. McDowell was 37th — last — at Darlington and had three speeding penalties and finished 29th at Richmond. The third penalty came while he was serving the second.

Byron is 15th in points, 116 behind, and McDowell is 136 behind.