KANSAS CITY, Kansas — Jimmie Johnson claimed his third NASCAR Sprint Cup Series victory of the 2015 season early Sunday morning at Kansas Speedway, winning the rain-interrupted SpongeBob SquarePants 400 that began Saturday night.

Kevin Harvick finished second. Johnson’s Hendrick Motorsports teammates, Dale Earnhardt Jr. and Jeff Gordon, took third and fourth.

Joey Logano rounded out the top five after overcoming pit road penalties — one for a crew member going over the pit wall too soon and another later in the race for pitting while pit road was closed.

Johnson recovered from an early race handling problem while running 23rd that caused him to fall farther back in the field. He came close to going a lap down but was saved by a yellow flag on lap 94.

“I guess the No. 88 (Earnhardt) got close behind me and just him being that close took the air off my spoiler and the car just turned sideways,” Johnson said. “I felt like I was fine catching it, but a lot of times you will over-correct and turn it back into the outside wall.

“Somehow I didn’t do that, so I was very happy to have my dirt background and keep that thing straight and going in the right direction.”

Johnson stayed out during the final caution of the race on lap 255 and restarted in the lead with six laps remaining.

“I could tell he (crew chief Chad Knaus) was having a hard time making the decision (to stay out or pit),” Johnson said. “I’m kind of running through the events in my mind. We have two wins, we are locked in the Chase and we are here to win a race. Let’s gamble; let’s go for it. Sure enough, it paid off.”

Harvick restarted sixth after taking two tires during the caution and quickly moved up to second but could not catch Johnson.

“Just racing hard there at the end,” Harvick said. “We had a lot of speed. The guys did a great job of adjusting on the car. Just didn’t have enough laps.”

Brad Keselowski got off sequence on his pit strategy soon after the race was red-flagged because of rain on lap 98. He pitted with the rest of the race field on lap 95 before the rain but stayed out through several cautions after the race resumed following a delay of more than two hours. As a result, he was forced down pit road for fuel on lap 164.

After the stop, Keselowski needed only one more stop to go the remaining distance compared with two for almost everyone else. But other drivers soon followed suit and opted to pit, putting them on a similar sequence as Keselowski.

Kyle Larson, Martin Truex Jr., and Harvick spent time up front before Johnson moved to the top spot with his late-race pit strategy.

Matt Kenseth finished sixth, Keselowski seventh, Kurt Busch eighth, Truex ninth and Ryan Newman 10th.

“It was up and down,” Kenseth said. “Before the rain, I thought we were pretty decent. After the rain, we just weren’t as good.”