TALLADEGA, Ala. (AP) -- Brad Keselowski was in trouble when he arrived at Talladega Superspeedway ranked 10th in the playoff standings. He knew he'd need a big finish to keep his championship chances intact.
Keselowski earned an automatic berth into the third round of the playoffs with a victory Sunday at Talladega, where he considered himself lucky to finish after a sloppy day for NASCAR.
"I survived," Keselowski said. "I feel like only eight cars finished the race. It was one of those crazy days ... a lot of attrition."
There were just 14 cars running at the conclusion, and only four were playoff drivers. The race was red-flagged three times for nearly 35 minutes.
By avoiding the carnage, Keselowski won for the fifth time at Talladega and gave Ford a season sweep of the four restrictor-plate races. Most important, though, is that he knows he's still in the hunt for his second Cup title.
Talladega was the perfect place for Keselowski to take the stress off his Team Penske team. He'd done it at the Alabama track before.
When the elimination format was rolled out in 2014, Keselowski had to win Talladega to advance. The race this year was moved to the middle event of the second round, so eliminations weren't at stake, but Keselowski no longer needs to worry about advancing.
He was the leader when the race resumed with three laps remaining, but was passed by Ryan Newman, who stayed out front until the final lap. Then Keselowski made his move around Newman on the high side of the track to take the lead, and a crossover move held off both Newman and Penske teammate Joey Logano.
Keselowski then collected the American flag for the victory lap on his 24th career Cup win, which came in his 300th start. His first career Cup win was at Talladega in 2009.
Dale Earnhardt Jr. finished seventh in his final race at Talladega, where he and his father combined to win 16 Cup races. Alabama declared Sunday "Dale Earnhardt Jr. Day."
Newman finished second in a Chevrolet and was followed by Trevor Bayne, Logano and Aric Almirola -- all non-playoff drivers.
"Brad and I work really well together on these speedways," Logano said. "I was able to push him up to the lead and I thought, `Alright, now I got you to the lead. It's my turn to get up there and try to win this thing.' Our never-quit-attitude got us a top-five out of a day that looked like we may not even finish. I'm proud of that."
Denny Hamlin finished sixth, the best of the Toyota drivers. But the manufacturer's playoff streak came to an end after Martin Truex Jr. and Kyle Busch gave Toyota wins in the first four playoff races.
Of the top 10 finishers, only Keselowski and Hamlin were playoff drivers.
The rest of the 12-driver playoff field had a rough afternoon.
McMURRAY's BAD DAY: Jamie McMurray's championship chances took a huge hit when he misfired on his attempt to pit early in the race. He was too high on the track when he tried to dart low to make the entrance to pit road, and forcing the issue in traffic caused him to wreck.
He entered the day in the transfer position for the playoffs, but he finished 37th on Sunday.
"There's nothing you can do about it. It's part of Talladega," he said. "We know you can come out of here with a lot of points and be a winner or you can be in the position we are right now. We'll go to Kansas and do our best. I'm sure I won't be the only playoff driver disappointed today."
UP NEXT: The final race in the second round of NASCAR's playoffs is next Sunday at Kansas Speedway. Four drivers will be cut from the playoff field.