Story highlights Dario Franchitti dedicates his win to his friend, the late Dan Wheldon

After a record-setting 35 lead changes, the Scotsman fends off a late charge to win

Wheldon, who won the Indy 500 last year, died in another race in October

The 1st all-female team participated in this year's Indy 500, finishing 22nd

Dario Franchitti won the 96th edition of the Indianapolis 500 motor race on Sunday, placing first in the prestigious race for the third time.

The Scotland native and husband of actress Ashley Judd bested a field of 32 other competitors, including a female racer backed by the first all-female team in the Indy 500. They circled the track 200 times, traversing a total of 500 miles, powered by fuel and raw adrenaline.

He and several other racers, including Scott Dixon and Tony Kanaan, traded the lead several times in the final minutes. But Franchitti was able to hold on and win, as he did in 2007 and 2010, after Japan's Takuma Sato tried to pass him on the last lap but ended up crashing instead.

The victory was especially meaningful for Franchitti, coming a year after his friend Dan Wheldon earned the checkered flag at Indy and seven months after the Englishman died after crashing during a race in Nevada. Franchitti, Dixon and Kanaan all mentioned after the contest how all three of them were close with Wheldon, who was very much on their minds as they jostled for the win Sunday.

In a photo on his Facebook page, Franchitti -- with a victory sash around his neck and bottle of milk, the traditional celebratory drink of Indy 500 winners, in his hand -- points to the sky in dedicating his win to his friend, known around the racing world as Lionheart.

"Everyone out there was a friend of Dan's. Everyone loved Dan," Franchitti told ABC, which broadcast the Indy 500. "What a great race today."

JUST WATCHED Female Indy 500 driver ready to race Replay More Videos ... MUST WATCH Female Indy 500 driver ready to race 03:14

JUST WATCHED Drivers talk about Wheldon, Indy 500 Replay More Videos ... MUST WATCH Drivers talk about Wheldon, Indy 500 02:44

The race featured a record-setting 35 lead changes, as well as a number of cautions -- including two in the final 13 laps -- as drivers fought for position, according to ABC. Nine drivers who started the race didn't end up finishing, for various reasons.

Three-time winner Helio Castroneves ended up in 10th. The 22nd place finisher was Katherine Legge, the ninth woman to qualify for the race and more notably the first to bring an all-female team with her.

The Englishwoman sported a Girl Scouts logo on her helmet and represented STEM (science, technology, engineering and mathematics) as an ambassador.

"My parents said, 'You can be anything that you put your mind to,' " Legge told CNN before the race. She said she hopes girls get the message "to follow whatever they want to be. And they have to pursue that with 110 percent knowledge that they can get there if they really, really want to."

For all the excitement during the race, much of the focus before it was on safety -- in part because of the death of Wheldon, a two-time Indy 500 winner killed in October in a 15-car crash at the Las Vegas Motor Speedway.

Wheldon died when his vehicle became airborne and hit a fence pole. A new design being used this year is supposed to prevent cars from becoming airborne.

Italian firm Dallara has created the new DW12 chassis, named for Wheldon, who helped test the car before his accident.

Wider cockpits, wheel guards, a smaller engine, vertical wings on the side panels and energy absorption foam have all been added to keep drivers safer on the track and in the event of an accident.

"We'll all be driving with heavy hearts," driver Marco Andretti told CNN hours before the grandson of renowned driver Mario Andretti ran well but ended up spinning out with 13 laps to go. "... I think we just have to think of what a happy person he was and how much he loved the sport and Indy in particular."

Meanwhile, the heat and humidity presented a challenge for drivers and spectators.

Temperatures were in the mid-80s by morning and were expected to reach into the low to mid-90s.

"There is a heat advisory for Indianopolis today," said CNN meteorologist Bonnie Schneider. "The temperature will soar to 96 degrees today and the heat index will climb to 100 degrees. Keep in mind that the normal high temperature for this time of year is 81 degrees, so this extreme heat is unusual."