INDIANAPOLIS — Tony Kanaan had one more lap, one anticlimactic last lap under the yellow caution flag, to end 12 years of frustration in the Indianapolis 500.
He flipped up his visor to wipe away tears as the crowd roared its approval, and then in Victory Lane gave his bride of two months a long kiss and poured the celebratory winner’s milk over his head Sunday.
Kanaan is Indy’s hard-luck loser no more. He is its champion at last, fittingly with a dose of good luck for a change.
‘‘I have to say, the last lap was the longest lap of my life,’’ Kanaan said.
It was one of Indy’s most popular victories.
The losers were pleased with the outcome, evidenced by a scene similar to rivals lining up to congratulate Dale Earnhardt when he finally won the Daytona 500 on his 20th try. Dario Franchitti, whose crash brought out the race-ending caution, stood grinning by his crumpled car, two thumbs up as Kanaan passed under yellow.
‘‘When I saw who was leading, it cheered me up a little bit,’’ said Franchitti, last year’s winner. ‘‘He’s a very, very deserving winner.’’
The fans thought so, too, standing on their feet, screaming ‘‘TK! TK! TK!’’ as he and team owner Jimmy Vasser went by during the traditional victory lap. It felt magical to Kanaan, like he had given the crowd at Indianapolis Motor Speedway a gift.
‘‘It means a lot to me because so many people, I could feel that they wanted me to win, and it’s such a selfish thing to do because what are they getting from it?’’ Kanaan said. ‘‘I’m the one who gets the trophy. I believed that this win was more for people out there than for me.
‘‘I wanted it all my life, but over the years I was kind of OK with the fact that I may never have the chance to win.’’
His chance came at the end of a history-making race at Indianapolis Motor Speedway, where Kanaan knew he had to pounce at the green flag for the final restart with three laps to go. He did, zipping inside leader Ryan Hunter-Reay to roar to the lead — where he wanted to be in case another caution came out.
‘‘I knew I had to get the lead on the restart because it could be a yellow, which happened to me plenty of times here, and it did,’’ Kanaan said. ‘‘How funny is life? The yellow was my best friend.’’
Kanaan had his fair share of chances to win at Indy, but came up short time and time again. He was leading when the rain came in 2007, only to lose to Franchitti when the race resumed.
In all, Kanaan went into Sunday’s race with 221 laps led at Indy — more than any non-winner except Michael Andretti and Rex Mays — but his second-place finish to Buddy Rice in 2004 was the closest he had come to victory. He had a pair of third-place finishes, including last year, again to Franchitti.
‘‘It’s wonderful for him,’’ said Mario Andretti. ‘‘He’s raced here long enough that he deserves it, no question.’’
The win for Kanaan and Vasser was celebrated throughout the paddock. Former driver Alex Zanardi, who came from Italy to watch the race and gave Kanaan one of his 2012 London Paralympics medals as good luck, wept behind the pit wall as Kanaan took the checkered flag.
‘‘I tell you I’m starting to think [the medal] really works,’’ said Zanardi, who lost his legs in a 2001 crash in Germany. ‘‘It’s a dream come true to see Tony win, to see Jimmy Vasser win, my dear friend. I’m so happy, I’m so happy.’’
It was Vasser who brought Zanardi’s medal to Kanaan before the race, telling his driver that Zanardi wanted him to rub it for good luck.
‘‘I actually cuddled with the thing,’’ Kanaan said.
Helio Castroneves, like Franchitti shooting for a record-tying fourth Indy win, was happy for his long-time friend.
‘‘Finally he’s able to win this race. He’s so close so many times, but the good news is the good old boys are still able to run fast,’’ Castroneves said.
Carlos Munoz, a 21-year-old rookie making his first IndyCar start, finished second and Hunter-Reay was third.
On the last lap, Franchitti brought out the caution seconds after Kanaan passed Hunter-Reay for the last of 68 lead changes — exactly double last year’s record.
On the final lap, the leaders came to the finish line bunched around Kanaan, saluting the IndyCar stalwart who had longed to add the final missing piece to his resume. That was about as slow as anyone had driven all day. The average speed was 187.433 miles per hour, an Indy record.
Marco Andretti finished fourth, failing to win for the eighth time, and Justin Wilson was fifth in the highest-finishing Honda on a day that was dominated by Chevrolet. Castroneves was sixth. Pole-sitter Ed Carpenter finished 10th.
For a time, it appeared the win would go to AJ Allmendinger, who led 23 laps in his Indy debut for Roger Penske.