(CNN) -- With a daring move in the last few laps, Tony Kanaan of Brazil passed American Ryan Hunter-Reay and won the 97th Indianapolis 500 under a yellow caution flag.
It was the second of two caution flags precipitated by crashes in the final eight laps of the 200-lap, 500-mile race at Indianapolis Motor Speedway.
"I got a little bit of luck today," Kanaan said in a post-race interview.
The race featured a record 14 leaders and 68 lead changes, with Kanaan making the last one between the two caution flags. No driver is allowed to pass another car while the caution flag is posted, so at that point, to win, all Kanaan needed to do was finish without crashing.
Despite the yellow flags, the average speed was 187.433 mph, setting another Indy 500 record.
Kanaan was a sentimental favorite after several near-misses in his 11 previous Indy 500s. Throngs gathered around him as he drank the winner's traditional bottle of milk and later kissed the Speedway's bricks.
Rookie Carlos Munoz of Colombia finished second, Hunter-Reay finished third and Marco Andretti placed fourth. Each of the top four finishers was driving a Chevrolet.
Ed Carpenter -- the stepson of Tony George, the founder of the IndyCar racing series -- sat in the advantageous pole position at the front of the field at the start of the race. He finished 10th.