Castroneves, his car having only enough fuel remaining to run another half lap at full speed, received a huge break when Buddy Lazier and rookie Laurent Redon collided during the 199th of the race's 200 laps.
That brought out the yellow flag, allowing Castroneves to slow down and virtually coast the final 2 ½-mile lap to victory.
Paul Tracy actually passed Castroneves before the leaders finished the 199th lap and insisted he had gone by Castroneves prior to the caution light being displayed. The owner of Tracy's car, Barry Green, protested the finish.
A final decision on the protest will not come until Monday, but television replays showed that the lighting system around the track had changed from green to yellow before Tracy got past Castroneves.
"We actually did an exhaustive search of all data and information that we had available to us, video and otherwise, to find out exactly when and what took place as best we could," said Indy Racing League vice president of operations Brian Barnhart.
"At the conclusion of lap 198, the beginning of lap 199, Castroneves was clearly in front of Tracy at the start-finish line. It stays that way through the sound end of the race track.
"Clearly based on the video that we have seen, the No. 3 car (Castroneves) is in front of the No. 26 car (Tracy) when the accident occurs in turn 2. It is clearly in front of the 26 car when the yellow was called for, it is clearly in front of the 26 car when it reaches the last timeline at the end of the backstretch going into turn 3. Based on all of that information, the 3 car was in front of the 26 at the end of the race."
"There is no evidence to overturn our decision. Take into consideration there is a lot more information that we provide to our teams, not just the track lights on the race track. We have mandated rules by the spotters and the race teams themselves have to listen to race control. They are hearing the call for the yellow."
Castroneves also benefitted from two race leaders dropping out during the second half of the racing spectacle.
Both Tony Kanaan and Tomas Scheckter had the lead when they slammed into the wall.
Redon and Lazier crashed in the second turn wall with two laps remaining, setting up a charge to the checkered flag. Tracy passed Castroneves heading to the yellow flag, but under Indy 500 rules, there is no racing back to the flag-stand, unlike the rules on the NASCAR circuit.
Rather than coming into the pits with about 40 laps remaining, Castroneves' crew chief Tim Cindric chose to leave his driver out on the track for the remainder of the race.
In hopes of saving fuel, Castroneves decided not to pass lapped traffic in front of him in hopes of gainnig a draft behind them.
"When Cindric said that there were three cars a lap down behind me, I decided to let them go and try to draft them and keep saving fuel," the race winner said. "It was working really good, but it still was very close (to running out of gas) and I was still praying for the yellow."
He said that just as Tracy was preparing to pass him, he saw the yellow light.
"There is a system in the IRL that the yellow light comes on (on the dashboard panel). I was so tense when the yellow came on because we also have a light for the fuel and I thought I was running out of fuel.
"And the guys on the radio said, 'yellow, yellow, yellow,' and I was so shocked. And then Tracy passed me very fast, and I was screaming, 'he passed on the yellow, he passed on the yellow.'"
Castroneves' car finally ran out of gas on its victory lap, after which he climbed out and took part in what has become his tradition -- climbing onto the protection fence and accepting the cheers of the crowd.
"I was crying like a baby," he said. "It was so emotional."
The 86th running of the race resulted in team owner Roger Penske's record 12th Indy 500 win.
Castroneves was about to run out of fuel before the yellow flag came out and the confusing finish ensued, but because there was no way for him to win if he pitted, he remained on the track for the wild final laps.
"I was holding my breath for sure," Penske said.
Al Unser was the last driver to win the Indianapolis 500 two years in a row, accomplishing the feat in 1970-71.
With three laps to go, it appeared that Felipe Giaffone would make a dramatic pass and emerge with the victory. But Giaffone was blocked by Tracy's teammate at Team Green, Dario Franchitti.
The move allowed Tracy to get a full head of steam and make a run at Castroneves. But once the yellow light came on, passing was not allowed.
"I think it's me that won," said Tracy, a driver on the CART circuit. "I know I was ahead of him going into Turn 3. He blocked me, I went to the inside, he blocked me, and then I passed him on the outside and the yellow light came out.
"It will be a big letdown if we don't get this, but we'll have to see what happens."
Castroneves took the lead with 20 laps left in the race.
Scheckter's bid to win the Indy 500 in his first attempt ended with a crash in the fourth turn wall while holding an eight-second lead on lap 174. Scheckter led 92 of the 174 laps to that point -- easily the most of any driver in the 33-car field.
While the cleanup process was underway, Gil de Ferran lost the left rear wheel on his Dallara/Chevrolet after his pit stop under caution, taking him out of any serious contention for the victory as he had to return to the pit area for repairs.
That put Giaffone in the lead, but he gave up the position when he made his pit stop on lap 176. Castroneves then took over the top spot.
Giaffone was third third with Alex Barron and Eddie Cheever rounding out the top five.
Video of Victoria’s Secret models trying to 'twerk' hits Instagram
Wisconsin business offering 'therapeutic cuddling' forced to close