Tony Kanaan, of Brazil, celebrates on the start/finish line after winning the Indianapolis 500 auto race at the Indianapolis Motor Speedway in Indianapolis, Sunday, May 26, 2013. (AP Photo/Tom Strattman)

Tony Kanaan, of Brazil, celebrates on the start/finish line after...

Tony Kanaan, of Brazil, (11) takes the lead from Ryan Hunter-Reay(1) on the 197th lap on his way winning the Indianapolis 500 auto race at the Indianapolis Motor Speedway in Indianapolis, Sunday, May 26, 2013. Justin Wilson (19), of England, finished fifth. (AP Photo/AJ Mast)

Tony Kanaan, of Brazil, (11) takes the lead from Ryan...

Dario Franchitti, center, of Scotland, along with safety team members, left and right, congratulate Tony Kanaan, of Brazil, who drives by under caution on his way winning the Indianapolis 500 auto race at Indianapolis Motor Speedway in Indianapolis, Sunday, May 26, 2013. (AP Photo/Tom Hemmer)

Tony Kanaan, second from right, of Brazil, passes Ryan Hunter-Reay (1) on the 197th lap to takes the lead on his way to winning the Indianapolis 500 auto race at the Indianapolis Motor Speedway in Indianapolis, Sunday, May 26, 2013. Carlos Munoz, of Colombia, (26) finished second, Ray finished third, and Marco Andretti (25) finished fourth. (AP Photo/AJ Mast)

The hard-luck loser no more, Tony Kanaan finally won the Indianapolis 500 on Sunday — with a bit of luck, at that.

In the mix all day during a record 68 lead changes, the popular Brazilian dipped inside defending IndyCar champion Ryan Hunter-Reay on a restart with three laps to go and cruised from there under the yellow caution flag.

He flipped up his visor to wipe tears from his eyes as the crowd roared, and then poured the celebratory winner's milk over his head in Victory Lane.

"I have to say, the last lap was the longest lap of my life," Kanaan said. "I got a little bit of luck today. I was looking at the stands, and it was unbelievable. I'm speechless. This is it, man. I made it.

"It means a lot to 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? I'm the one who gets the trophy. And if you can bring some joy to them and I think the best thing was trying to put an exciting race for them. And I said it before the race, I believed that this win was more for people out there than for me."

Kanaan had his fair share of chances to win at Indianapolis Motor Speedway, but came up short time and time again. He was leading when the rain came in 2007, only to lose to Dario 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.

"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," Kanaan said. "We can disprove the theory that nice guys don't win. We proved that wrong."

This time, it was Franchitti whose crash brought out the final caution to seal Kanaan's victory.

"It's wonderful for him," said Mario Andretti, himself a victim of bad luck at Indy. "He's raced here long enough that he deserves it, no question."

The win for Kanaan and car owner Jimmy Vasser was celebrated throughout the paddock. 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.

"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.

"T.K. is such a fan favorite, absolutely, it's great to see him win it. If anybody is going to win it in the field, he's one of the few I'd like to see other than myself," Hunter-Reay said. "We were leading on that last restart, I knew I was a sitting duck, and I wasn't too bummed about it because I knew we had enough laps to get it going again and have a pass back. Maybe I would be third on the last lap, which is where I wanted to be."

Only there wasn't a last lap as Franchitti brought out the caution seconds after the race went green.

"I went into the first corner on the last restart and it just didn't turn and then hit. The big, old hit," said Franchitti. "When I saw who was leading, it cheered me up a little bit. He's a very, very deserving winner."

The leaders came to the finish line all bunched up around Kanaan, saluting the longtime 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 mph, another 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 led a race-high 37 laps and finished 10th.

For a time, it appeared the win would go to AJ Allmendinger, who led 23 laps in his Indy 500 debut for Roger Penske.

Fired by Penske from his NASCAR ride last year after failing a NASCAR drug test, Penske gave him a second chance with this IndyCar opportunity. Seven years after leaving open-wheel racing, Allmendinger finally ran "The Greatest Spectacle in Racing" and was leading when his seat belt came undone, forcing him to pit.

It put Allmendinger off the pit cycle, and he was forced to stop for gas twice far in advance of the rest of the field. It meant Allmendinger had to drive his way back to the front each time, and he finally sputtered out at seventh.

"Once I figured it out, it was phenomenal. I could drive by guys at will when I wanted to," Allmendinger said. "I felt like we were up front running our own race, and, I don't know, belts come undone. It just popped.

"I'll be honest, pretty special moment to be leading at Indy," he said. "My body kind of went numb, my mind was racing and I could feel my heart beating really fast, and that's a special moment I'll never forget."