HOMESTEAD, Fla.—It was not the dramatic championship run he was hoping for, but Brad Keselowski won his first Sprint Cup championship Sunday with five-time champion Jimmie Johnson sitting in the garage.

Johnson, who entered the race trailing Keselowski by 20 points, fell out of the race with an oil line problem with 40 laps remaining and Keselowski running seventh. Keselowski won the title with a 15th-place finish.

Johnson had won five straight championships from 2006-2010 and was hoping for a miracle to catch Keselowski, who took the points lead when Johnson crashed last week at Phoenix.

Instead, Johnson had more trouble. He was gambling on fuel mileage when he had a lug nut missing after a pit stop, drawing a stop-and-go penalty that put him a lap down.

Moments later, Johnson told his crew he had smoke in the cockpit and had to pit.

When Johnson’s crew pushed his car to the garage, the championship race was essentially over. With 20 laps remaining, NASCAR officials declared that the championship race was over and that Keselowski was the new champion.

“It’s pretty heartbreaking," Johnson said. "We were doing what we needed to do, but that’s racing. Stuff happens. It’s not the result we wanted, but I’m proud of the way we raced. That’s life. We’ll come back next year.”

Keselowski, meanwhile, launched into a wild victory lane celebration.

"It's been one heckuva day and this is one heckuva team," the slightly inebriated Keselowski said as he hoisted a two-foot-tall glass of beer.

Meanwhile, Jeff Gordon stretched his fuel mileage to win the race. Gordon won his second race of the season a week after he was fined $100,000 and docked 25 points for intentionally wrecking Clint Bowyer at Homestead.

Gordon had to answer questions all week about last week's run-in with Bowyer, whom he retaliated against after Bowyer ran into him on the track. Gordon wasn't dominant throughout the race, but stretched his fuel mileage and took the lead when leader Kyle Busch, who dominated the race, had to pit late for fuel.

“After what happened last week, to come back and battle all day and win is a great way to end the season," Gordon said.

Bowyer not only finished second, but wound up finishing second in the final points standings, 39 points behind Keselowski. Johnson finished third, 40 points behind.

Asked if he wondered about having a shot to catch Keselowski in the standings had Gordon not wrecked him last week, Bowyer said, "Catching the 24 (on the track), that was the only what-if I was thinking about."

The championship was not only the first for Keselowski but the first for Penske Racing and team owner Roger Penske.

"It's been a great season. I can't take my hat off enough to this whole team," Penske said. “The competition is so super in this series. It’s just something you have to work on. These guys are the best.”

Keselowski survived on a day when he didn't have a fast car and had to race conservatively. He overcame a slow pit stop and a fuel-mileage strategy that seemed at the time like it might foil him. But like all season, he persevered.

"I'm not the biggest guy and I'm not the strongest," he said. "I've been fast at times and I've been not so strong, but I've been hearing that my whole life. It gives me fuel to do this."

Johnson was on pace to finish the race on one fewer pit stop than Keselowski, leaving Keselowski in a precarioius position, and giving Johnson a slim hope of finishing at least 20 positions ahead of Keselowski and winning the championship.

Those hopes ended, however, with the missing lug nut.

After Johnson pitted for the second time to serve his penalty, he had lost a lap and was 25th while Keselowski was seventh.

Keselowski, meanwhile, averted disaster on his pit stop. He was in fuel conservation mode and had to pit earlier than Johnson, but ran out of fuel on pit road. He coasted to his pit, however, and his team made a clean stop and got him back on the track without losing much time.

But after Johnson’s penalty, Keselowski could breathe easy again.

Told by his crew that Johnson had been penalized and lost a lap, Keselowski said, “10-4. We’re back in the game. I got it!”

Moments later, Johnson smelled smoke in the cockpit of his car and told his team he had to pit. When his crew pushed his car to the garage, the 10-race Chase was over and Johnson had missed a sixth championship for the second straight year.

He essentially lost the championship, he said, when he had tire trouble and crashed last week at Phoenix, giving Keselowski a 20-point lead.

“I’m proud of the way we went out and put pressure on them, but that doesn’t take the sting away," Johnson said. "It takes 10 clean races to win one of these things, and we hurt ourselves in Phoenix.”

While Busch and Martin Truex Jr. swapped the lead, Keselowski ran a conservative race, staying out of trouble and trying not to put himself in position to find trouble.

Keselowski started on the front row after polesitter Joey Logano had to drop to the rear of the field after wrecking in practice, but couldn’t accomplish his goal of leading the first lap. Marcos Ambrose darted to the front while Keselowski, battling a tight car, faded a bit and settled into fifth.

Keselowski was running sixth when the leaders pitted under green for the first time around Laps 46-47. After green-flag stops, Johnson was running seventh and Keselowski ninth.

A few laps later, Keselowski caught him and the two engaged in a close side-by-side battle for seventh for several laps. Keselowski eventually took the position, but Johnson stayed close to his bumper, shadowing him.

Johnson stalked Keselowski for the next 20 laps before finally swooping past him on Lap 74.

After the first caution flag on Lap 78, Keselowski and his team had their first slip-up of the race. A slow pit stop when a lug nut stuck on the right rear cost him several positions and he dropped to 13th on the ensuing restart.

But by Lap 100, Keselowski was back up to eight—two spots behind Johnson—and told his team, “I’m just chilling for a second.”

Keselowski made his last stop on Lap 205.

By the halfway point of the race, Keselowski had settled into the 11th position while Johnson ran third while Busch and Truex battled for the lead.

Keselowski then lost more ground during the next caution period on Lap 143. When the leaders pitted, Johnson took just two tires to take the lead, while Keselowski went with four but slipped back to 15th in the running order.

Keselowski got back in front of Johnson by staying on the track during the next caution period, but Johnson blew back past him on the restart on Lap 161 and headed back toward the front while Keselowski settled back into 11th, continuing to run conservatively.