Updated

Tony Stewart put his season back on track by winning Sunday's FedEx 400 at Dover International Speedway.

Stewart snapped a 30-race winless streak after passing Juan Pablo Montoya for the lead with just three laps remaining around this one-mile, concrete- surfaced racetrack. During a late-race caution for an accident involving Denny Hamlin, Montoya beat Jimmie Johnson out of the pits to take the lead. When the race resumed with 19 laps to go, Johnson quickly pulled ahead of Montoya for the top spot, but NASCAR ruled that Johnson jumped the restart and therefore penalized him with a pass through on pit road.

Stewart, who was never a factor until late in the race, chased down Montoya during the final 10 laps before making his winning pass. He ran in third for the last restart. Stewart led just the final three laps, beating Montoya to the finish line by 0.8 seconds.

"(Crew chief Steve) Addington's pit strategy gave us the opportunity there at the end," Stewart said. "It's pretty cool when it's the only time you get to beat Juan Pablo Montoya. He figured out where I was gaining ground, and he made the adjustment and got going from there. I had to move around again. I stuck on the top (of the track) there."

It was Stewart's 48th career win in the Sprint Cup Series but his first since July 2012 at Daytona. Prior to his victory at Dover, Stewart's best finish this season was seventh, which came one week ago in the 600-mile race at Charlotte. His victory allowed him to move from 20th to 16th in the point standings.

"It's been such a tough year," said Stewart, who is a three-time Sprint Cup champion. "We've let down our (fans) for a long time. Hopefully, we'll start building momentum back now."

Stewart scored a season-sweep at Dover in 2000 but had not won a race here since then.

"It's been a while," he said. "We tested here, which I thought would be an advantage coming here. (In Saturday's final practice), we took two steps backwards. It just didn't seem like we were much better."

Montoya's winless streak in the series has now stretched to 99 races. He was attempting to win his first race on an oval. His first two victories have come on road courses (2007 in Sonoma, Calif. and 2010 in Watkins Glen, N.Y.).

"It's a shame there at the end," Montoya said. "(The car) was way too loose, and I just couldn't hold Tony off."

Johnson, who was attempting to win his record eighth race at Dover, finished one lap behind in 17th. He also was one lap down early in the race.

"I was half-throttle for the whole frontstretch," Johnson said of the final restart. "At some point, I have to go. In this situation, NASCAR has the judgement of deciding whether you jumped the restart or not. (Montoya) wasn't even going. I'm not sure if his car broke, lost power or spun his tires. I don't know."

Johnson's total of 143 laps led came during the second half of the race.

"Bummer way to lose a race," he added. "We certainly had the winning car. We'll just come back and do it in the fall."

Montoya at first thought Johnson had jumped the restart.

"Jimmie was laying off about a car length from me, and I knew he was trying to jump the restart," he recalled. "I backed off a little bit for us to line up, and he didn't want to do it.

"When we got to the line, I think he wanted to time it, and he timed it too well. He wanted to get the jump on me, and he just jumped it too much. I would have tried to do the same. It's one of those deals that when you time it too good, it actually hurts you."

Jeff Gordon finished third, while Kyle Busch and Brad Keselowski, the defending Sprint Cup champion, rounded out the top-five. Busch led the most laps with 150. Keselowski had several key members of his No. 2 Penske Racing team, including crew chief Paul Wolfe, back at the track this weekend after serving their suspensions for two races due to illegal parts found on Keselowski's car prior to start of the April 13 event at Texas.

Clint Bowyer took the sixth spot, followed by Joey Logano, Kevin Harvick, who won at Charlotte, Mark Martin and Dale Earnhardt Jr.

Hamlin, the pole sitter, ended up finishing 20 laps down in 34th due to his accident. He blew his right-front tire and slapped the outside wall for the seventh and final caution.

On lap 301, Ryan Newman and David Gilliland were involved in a wreck along the backstretch. Newman turned Gilliland around with both drivers making contact with the wall. The two had been battling hard for position several laps prior to their incident.

Gilliland had a heated exchange with Newman while Newman was still sitting in his car at the site of their crash.

"What were you thinking?" Gilliland said when he had approached Newman. "The 7 car (Dave Blaney) was holding me up. (Newman and I) were both going, and we were racing each other. He was just way too aggressive."

Newman did not comment on the incident.

Toyota drivers Matt Kenseth and Martin Truex Jr. had their day come to an end early due to engine failure. Kenseth, who leads the series with three wins this season, had the motor in his Joe Gibbs Racing car expire on lap 157.

"Something broke in the engine," Kenseth said. "It's disappointing. I feel like JGR has three of the strongest teams in the garage, and it seems like we've got the best cars out there, equal to the best cars, but you have to finish these things. There's been some issues in the (engine) department. I've got a lot of faith in those guys. They'll get it figured out."

Truex, who hails from nearby Mayetta, N.J., had the engine in his Michael Waltrip Racing car blow on lap 279.

"It hurts," he said. "We had a really good race car today. We were running second, third, fourth all day long, and I felt like we were just a little bit away from having something for the win."

Truex's lone win in Sprint Cup came in June 2007 at Dover.

As the 26-race regular season reaches its halfway point, Johnson holds a 30- point lead over Carl Edwards, who finished 14th. The regular season concludes on Sept. 7 at Richmond, with the 12-driver field determined for the 10-race Chase for the Sprint Cup championship.