Ricky Stenhouse Jr. survived the late carnage at Talladega to win Sunday's NASCAR Geico 500.

Stenhouse, who started on pole, held off a push from Jamie McMurray and Kyle Busch to end a long winning drought for Roush Fenway Racing. 

Stenhouse passed Busch on the final lap of the green-white-checkered finish to get the first Roush victory in 101 races.

It was the 24th time the winner at Talladega was decided by a last-lap pass. It was Stenhouse's first-ever win at Talladega in 158 starts. 

"This is for all the guys at the shop," Stenhouse told Fox Sports. "This year, every race we're getting better. We knew Talladega was a good track for us. I can't say enough about the guys."

Dale Earnhardt Jr., who started second, was near the front following a restart after an 18-car pileup until a loose left rear tire pushed him to the rear. He finished 22nd.

Ryan Blaney spun out on lap 160 to bring the caution flag out for just the fifth time in the race.

Blaney was forced to go to the garage, but did re-enter the race. He did not finish, though, because he got caught in the big wreck that finally happened on lap 168. 

Michael McDowell, AJ Allmendinger, Danica Patrick, Chase Elliott, Kevin Harvick and Austin Dillon were also among 18 cars involved in the pileup.

It started when Allmendinger tapped Elliott to spin him around and force the latter onto the wall. Allmendinger's car then got rolled onto its lid, but no drivers were injured.

Brad Keselowski, who had four previous wins at Talladega, finished seventh after winning the first stage. Stage 2 winner Denny Hamlin was 11th, while Monster Energy Cup points leader Kyle Larson was 12th.