Spoiler alert: Johnson takes Texas win away from Keselowski

Jimmie Johnson passed Brad Keselowski with four laps to go to win Sunday's AAA 500 at Texas Motor Speedway.

Keselowski started from the pole and led a track-record 312 of 334 laps, but he couldn't hold off Johnson in the closing laps.

Kevin Harvick came home third, with Martin Truex Jr. and Carl Edwards completing the top five.

The AAA 500 was the second of three races in the Eliminator Round of the Chase.

Jeff Gordon, last week's winner at Martinsville, will race for the championship, with the final three Championship round slots to be filled next Sunday at Phoenix International Raceway.

Joey Logano, Keselowski's teammate and a six-time winner this season, was eliminated from contention early when a tire failure on Lap 4 sent him to the garage for extensive repairs. Logano will have to win at Phoenix or he will be eliminated from title contention.

Johnson's win leaves three spots up for grabs at Phoenix, the last race before the Nov. 22 finale at Homestead-Miami Speedway.

Kyle Busch is second behind retiring four-time champion Gordon, Johnson's teammate at Hendrick Motorsports. Kevin Harvick is third and Martin Truex Jr. fourth.

Keselowski is sixth in points after coming ever so close to winning in Texas.

The Associated Press contributed to this report.