Then Johnson's engine faltered with only six laps remaining. He lost the race — and the NASCAR Sprint Cup points lead — to Greg Biffle on Sunday.
"I got it turned around and was catching him, and then his engine failed," Biffle said. "It was going to be a great race, no matter what. I felt like I could catch him, but we'll never know. Passing him might have been a different story."
Biffle won the race at Michigan International Speedway, taking advantage when Johnson left the track because of engine trouble. Johnson started the race from the back because of an engine change, and he couldn't hold on at the end. He finished 27th.
After Johnson's mishap, there was a caution for oil on the track. Biffle held off Keselowski by 0.416 seconds in the green-white-checkered finish.
Biffle took over the points lead, while Johnson dropped from first to fourth. Matt Kenseth moved up a spot to second despite a 17th-place showing.
"I know that a lot of people don't expect us to win the championship, and don't expect us to compete for the title," Biffle said. "I don't care what they say or who they want to talk about, but we will be a factor when it comes down to Homestead. I promise you that."
Kasey Kahne finished third in the 400-mile race, followed by Dale Earnhardt Jr. and Marcos Ambrose.
It was the 12th victory for Roush Fenway Racing at MIS, breaking a tie with the Wood Brothers for the most wins at the track.
Pole sitter Mark Martin was sailing along in the lead for most of the first 65 laps before his race ended in scary fashion. Bobby Labonte went into a spin while Martin was coming up from behind, and Martin went sliding off toward pit road. His car crashed frighteningly into the end of a short, narrow barrier on the interior side of pit road.
The side of Martin's car was essentially impaled by the end of the wall, just in front of the left rear tire and dangerously close to the driver's seat. But in the smoky scene that followed, Martin was able to get out and walk away.
"I really feel that was a freak accident. I'm not sure you can ever completely fix something like that," Martin said. "That was a pretty freak angle that I got it. I'm not sure what you can do. It could have been really bad if I would have got into that hole a little deeper where it would have caught me in the door instead of the crush area back there."
Johnson started from the back, and so did Earnhardt, who was using a backup car after a mishap in practice Saturday. The two Hendrick Motorsports teammates made a solid run of it, but it was Biffle and his No. 16 Ford that emerged at the end.
Johnson did not speak to reporters afterward. He was trying to become the first driver to reach four victories this season. Keselowski and Tony Stewart also have three, and drivers will earn bonus points in the Chase for the Sprint Cup for "regular-season" victories.
The Chase starts next month.
"The 48 has the most speed and the best history as far as the Chase is concerned," Keselowski said. "We caught a lucky break that was unfortunate for Jimmie. ... He definitely deserved to win the race. Just didn't play out that way."
It was Biffle's second win of the year and third career victory at MIS. Keselowski, racing in his home state, settled for second place for the second straight week.
"Just a great day," Keselowski said. "I don't know what to say other than I was this close to getting what would have been one of the biggest wins of my career. That would have been really special."
Biffle's victory was his 18th on the Cup circuit.
Earnhardt won at MIS in June, snapping a four-year losing streak. The last driver to sweep the two Cup races at MIS was Labonte in 1995.
Earnhardt bounced back with a nice showing amid adversity. That was after finishing 32nd at Pocono and 28th at Watkins Glen the last two races.
Stewart and Jeff Gordon both had motor problems, finishing 32nd and 28th. Gordon, Kyle Busch and Carl Edwards entered the race on the outside looking in for the Chase.
Those three didn't do much to change that. Edwards finished sixth and Busch was 13th. There are three more races before the Chase starts. Right now Kahne and Ryan Newman are in line for the two wild card spots that go to the drivers between 11th and 20th in the standings with the most wins.
Busch, Gordon, Ambrose and Joey Logano could edge out Newman if any of them win another race.