SONOMA, Calif. -- Tony "Smoke" Stewart sometimes is at his best when he's frustrated.
Just two days after he said racing Sprint Cup cars didn't make him happy, Stewart snapped an 84-race winless streak and turned his final NASCAR season into a potential championship run as he made a last-turn pass on Denny Hamlin to capture the Toyota/Save Mart 350 at Sonoma Raceway.
Stewart was in position to win when he pitted 25 laps before the finish and the caution came out one lap later. Everyone else on the lead lap pitted, and Stewart took the lead with 22 laps remaining. He held on to it nearly the rest of the way before Hamlin bumped him in Turn 7 to pass him on the last lap. Hamlin took the final turn wide, and Stewart was able to get underneath Hamlin to make the pass and win the race.
"They're all good. It doesn't matter where you get them," Stewart said about his 49th career Sprint Cup win. "But we ran close to those guys all day. We just got stuck back in traffic [before the pit stop]."
Hamlin stuck his head into Stewart's car after the race to congratulate him. They were teammates for several years at Joe Gibbs Racing before Stewart became a co-owner of Stewart-Haas Racing in 2009.
"I felt a nudge when I got down there [in Turn 7], and he knew where it was, and he did the right thing doing it there," Stewart said. "But if I could get to him, he knew what was coming. He told me he was proud of me. He knows what it means. We were teammates for a long time, and we respect each other a lot."
Stewart said he had nothing to prove to himself or others after he halted his losing streak.
"I'm happy doing what I'm doing," Stewart said. "I'm still happy about my decision to make the change I'm making next year. ... I feel like we're gaining ground here, and I'm proud of [my] guys."
Hamlin had led a race-high 33 laps but said his tires were too hot for him to take the inside line he needed in the final turn.
"I got out of line and obviously gave him the inside line, and once I knew he had position and we had a wall on the other side of us that I knew a pretty good chance we would go in the wall [if I pressed the issue] -- I don't think he was going to leave it to chance for a drag race [to the finish]," Hamlin said.
"It was a great, fun race. We were fortunate to be in that position. We definitely had a car that could have and should have won. We were just on the bad end of the deal."
Stewart's last win came in June 2013 at Dover. Since then, he missed 15 races in 2013 with a broken leg and three races in 2014 after the Kevin Ward Jr. tragedy. Stewart missed the first eight races of the 2016 season because of a broken back suffered in a dune buggy accident in California.
With the win, he is eligible for the Chase for the Sprint Cup and just needs to be in the top 30 when the regular season ends in 10 races. He sits 32nd in the standings, nine points out of 30th.
"It just puts so much behind him and closure to a lot of things to be back in Victory Lane," said 2014 Cup champion Kevin Harvick, who drives for Stewart. "For the company to have him winning ... I know he's just had a miserable three years. To see him in Victory Lane -- I'm happier for him than anything we've done in the past because it personally is such an accomplishment for him."