INDIANAPOLIS — Same team, same country, different driver.

Gil de Ferran held off Helio Castroneves on a six-lap sprint to the end Sunday to win the Indianapolis 500, spoiling his Brazilian teammate's bid for an unprecedented third straight victory.

De Ferran, who was severely injured in a crash March 23 in Phoenix, passed Castroneves for the lead on lap 170 of the 200-lap race at the Indianapolis Motor Speedway and had to fend off his Penske Racing teammate through three restarts.

A joyous and tearful de Ferran clutched his helmet with both hands after reaching Victory Lane, then — wincing in pain as he squeezed out of the seat — stood and threw his arms into the air in triumph as his son and daughter climbed onto his car.

"In the last few laps, I was thinking, 'Is this really happening?' I tried not to get carried away," de Ferran said. "The last few laps it was definitely very, very difficult to focus. I was overflowing with emotion."

The victory was the third straight for team owner Roger Penske, whose record for wins at Indy climbed to 13.

Castroneves did everything he could to put his name into the history books, pushing de Ferran to the end and finishing behind him by only 0.299-seconds — about five car lengths. It was the third closest finish in 87 Indy races.

The late cautions may have prevented Castroneves from a serious challenge.

"Unfortunately, the yellows kept coming at the end," he said.

The win was a major step for de Ferran, who skipped the final race of the 2002 season with a concussion from a crash, then missed the IRL's Japan race last month while recovering from another concussion and broken bones in his neck and lower back.

That accident left the 35-year-old de Ferran flat on his back for several weeks, and he was unable to return to his race car until May 3, the opening day of practice for Indy.

He drove in pain to the biggest victory of his life.

"My shoulders, halfway through the race, started cramping," de Ferran said. "I really couldn't lift my arms. My back wasn't hurting. I've got to find out what happened. Maybe it's something to do with the neck. It was getting more and more and more painful."

The situation was reminiscent of 1996, when Buddy Lazier won the race while recovering from a painful back injury.

Castroneves started from the pole and de Ferran began 10th in the 33-car field. Both Penske drivers spent the race putting themselves in position for the finish that reversed the order of Castroneves' first win in 2001.

Castroneves beat Tomas Scheckter out of the pits on lap 129 during a caution period to take the lead. De Ferran was third on the restart on lap 134 but quickly shot past Scheckter to make it Penske 1-2.

Both made their final pit stop on lap 166, moved back to the front when the other leaders made their final stops and stayed there the rest of the way.

Four laps later, Castroneves found himself caught behind the slow-moving car of rookie A.J. Foyt IV. Waiting to see what Foyt would do, Castroneves slowed and downshifted. By the time he reached the back straightaway, de Ferran had sped past.

"I was trying to take it easy," Castroneves said. "Unfortunately, I took it too easy. You can't sleep at all at this place. This place is always full of surprises."

Rookie Dan Wheldon brought out the last of nine caution flags when he slammed into the fourth turn wall, flew into the air and landed upside down. Wheldon, who had been running in the top six most of the day, was not injured.

Another rookie, Scott Dixon, held up the restart when he scraped the wall and spun on the main straightaway.

Finally, the green flag waved again on lap 195, and de Ferran got a quick start, pulling away from Castroneves. That was the way it stayed.

"I'm disappointed, but Gil, you deserve it," Castroneves said. "You did well. Now, let's go and (win) a championship. That's what we need."

The two Brazilians climbed the fence at the finish line to the cheers of fans after the race, a Castroneves tradition for the past two years.

De Ferran led only the final 31 laps. He averaged 156.291 mph, finishing the race in 3 hours, 11 minutes, 56.99 seconds.

Tony Kanaan made it a 1-2-3 Brazilian sweep with a third-place finish for new team owner Michael Andretti, and Scheckter wound up fourth after leading a race-high 63 laps. Rookie Tora Takagi was fifth, less than 2 seconds behind the winner.

Andretti, making his last start as a driver, had another in a long list of Indy disappointments for his famous racing family. His father, Mario, won Indy in 1969 and spent 24 years trying in vain to do it again.

For Michael Andretti, this was his 13th try and he wound up coasting to the pit lane after 94 laps with a broken piece in the throttle, which cut engine power.

Andretti led 28 laps, making his Indy total 426, the most by any non-winner and just three fewer than four-time winner Rick Mears.

"It wasn't meant to be," he said. "The car was running very good, and we were running at the top all day. At least I can say I had a good shot at winning my last race."

Wheldon and Robby Gordon also were driving for the new Andretti Green Racing team, but Wheldon wound up 19th and Gordon 27th after a gearbox failure.

Gordon completed 169 laps and flew to Concord, N.C., for NASCAR's Coca-Cola 600.

"It would have been a lot easier to run 600 miles tonight ... with a better finish," said Gordon, who was attempting "The Double" for the fourth time.

Two-time winner Al Unser Jr. ran in the top 10 most of the day and finished ninth, the last driver on the lead lap.

The race, the first 500-mile test for the all-new Toyota, Honda and Chevrolet engines mandated by the Indy Racing league for 2003, was marred by blown engines and crashes.

Among those who had engine failures were 1996 Indy winner Buddy Lazier, two-time defending IRL champion Sam Hornish Jr., Jimmy Vasser, Robbie Buhl, Billy Boat, Sarah Fisher and Felipe Giaffone.

Toyota won the battle, powering de Ferran's G Force to the victory for the Japanese company's first Indy win and taking six of the top seven spots.

Honda's top finisher was Kanaan, while rookie Buddy Rice led the Chevy teams with a 11th-place finish.

Castroneves led the first 16 laps before pitting under a caution flag that was brought out when Fisher, the only woman in the field, ran through the fluids from her own blown engine and slammed into the wall.

Indy rookie Scott Dixon took the top spot and led until he ran out of fuel on lap 31, giving the top spot for the first time to Andretti.

Foyt, grandson of the first four-time Indy winner, drove to 18th place on his 19th birthday. He finished 11 laps behind de Ferran.