MARTINSVILLE, Va. — Jimmie Johnson raced to his seventh career Martinsville Speedway victory to take the season points lead with three event left, holding off Kyle Busch on a restart with five laps to go Sunday.

The five-time series champion moved two points ahead of Brad Keselowski, who finished sixth for his highest career finish at the track.

“I know this championship’s going to come down to Homestead,” Keselowski said. “You’ve just got to be in position to where you’ve got a shot at it and we’re doing the things it’s going to take.”

Keselowski started 32nd, methodically worked his way forward, and was never really a factor until he took a late gamble to grab the lead — and a crucial bonus point. He was leading the race briefly and he and Dale Earnhardt Jr. stayed out under a caution, while the other 16 cars on the lead lap all headed for pit road for fresh tires.

“I think we’ve learned a lesson here in the past not pitting late, and that certainly came into play,” Johnson said. “I felt like it was going to be a problem for him. We’ve been there before and stayed out and got beat.”

When the race went back to green with 19 laps to go, Keselowski was a sitting duck whose best bet was to hang on for as long as he could and then avoid any Martinsville mayhem that cropped up in a furious dash to the finish.

Johnson, who led eight times for 193 laps, passed him on lap 487 on his way to making the race a bonus points bonanza. He got one for leading a lap, one for leading the most laps and three for the victory, wiping out a seven-point deficit.

Busch was second, followed by Kasey Kahne, Aric Almirola, Clint Bowyer, Keselowski, Jeff Gordon and Brian Vickers.

On the final restart, Busch said he was trying to avoid spinning Johnson heading into turn one, but nudged him. Johnson slowed, and Busch too, and “when I went back to the gas, I spun my tires and got loose, and he squirted away from me.”

Bowyer also had a great car, leading 154 laps, and Gordon led 92.

While the championship race tightened at the top, it also eliminated Denny Hamlin, who seemed poised to get in the thick of it, and then had an electrical problem that sent him to a 33rd place finish and out of title contention.

“When these things happen, you’ve just got to suck it up and move on,” Hamlin said. “There’s nothing I can do about it. One of these days it’s going to be our time. It’s just not right now.”

Until the problems arose, Hamlin had put on a clinic about how to pass cars on the 0.526-mile oval.

After his first pit stop, Hamlin was penalized for entering pit road too fast, a penalty that moved him to the back of the lead lap, which was 31st. Immediately, he started quickly working his way forward.

After 200 laps, he was contending and actually left pit road with the lead, but again, he was penalized for speeding entering pit road, again dropping him to the back of the lead lap, this time 28th.

He again worked his way into the top five until his problems dropped him 34 laps behind.

Bowyer is third in points, 26 back, and Kahne is 29 back. Hamlin dropped 49 points off the pace.

Formula One

VETTEL WINS INDIA GP, EXTENDS TITLE LEAD: In Greater Noida, India, Red Bull driver Sebastian Vettel won the Indian Grand Prix on Sunday to extend his Formula One championship lead, though rival Fernando Alonso of Ferrari kept up the pressure with a second-place finish.

Vettel won a fourth straight race for the first time in his career and now leads the drivers’ championship by 13 points with three races to go, chasing a third successive F1 title.

Red Bull’s Mark Webber clung on to third place, under pressure from McLaren’s Lewis Hamilton, who was fourth.

McLaren’s Jenson Button was fifth and Ferrari’s Felipe Massa sixth.

IndyCar

BERNARD STEPS DOWN AS INDYCAR CEO: Randy Bernard has stepped down as CEO of IndyCar.

Jeff Belskus, President and CEO of series owner Hulman & Co., will step in as interim CEO.

Bernard will stay on in an advisory position.

The decision was reached following an executive session Sunday of the 11-member Indianapolis Motor Speedway board of directors.

It ends a month of speculation about Bernard’s future that reached a fevered pitch last week, when Bernard and an IMS spokesman denied a report that Bernard had been fired.

But a mutual decision was reached Sunday for Bernard to step down as CEO to end the suffocating speculation that has overshadowed one of the best seasons in series history.

It comes nine days after series founder Tony George resigned from the Hulman & Co. board of directors.