(ABC News) -- Before Captain Marvel emerged as one of the galaxy’s biggest superheroes, she was U.S. Air Force fighter pilot, Captain Carol Danvers.
To prepare for the title role in the new “Captain Marvel” movie, Brie Larson learned about what it takes to be an F-15 fighter pilot from an Air Force pioneer, Brigadier General Jeannie Leavitt, the Air Force’s first female fighter pilot.
That connection has given the Air Force an opportunity to reach new audiences, particularly young girls who could become the next generation of fighter pilots.
In early 2018, Larson and the movie’s production team visited Nellis Air Force Base in Nevada to visit Leavitt and hear about her experiences.
“She wanted to talk to female fighter pilots and see what it was like," Leavitt told ABC News at a Washington, D.C., screening of the movie.
During the visit, Leavitt described some of the adversity she experienced in the early 1990s as a pioneer female pilot, and the Marvel movie out this week incorporates some of the negativity and chauvinism that she experienced.
Already trained as an Air Force pilot, Leavitt had not experienced difficulties from peers until she was selected to serve with what had been all-male fighter squadrons.
"The time that it really became very male-dominated was once I transitioned into fighter aircraft because there were no other women," said Leavitt. "Honestly, I did not want to be the first female fighter pilot. I just wanted to be the best fighter pilot."
Leavitt later helped Larson with some of the small details that only fighter pilots could know.
Leavitt was also on set to help Larson during the Air Force-related shoots, teaching her the proper way to carry her helmet bag while walking out to an F-15 fighter. Pilots carry it in their left hand or over their left shoulder so they can salute the crew chief with their right hand when they approach the aircraft.
In the movie, Danvers drives the same type of car that Leavitt drove and wore the same type of leather jacket.
The movie also fits in nicely with Leavitt's current job as the head of Air Force recruiting.
"We're looking for people with physical strength, moral strength, mental strength, grit and determination to join our team," she said.
This week's screening of the movie at the Smithsonian Institution's Air and Space Museum included a science and technology display for young men and women to show the opportunities available in the Air Force.
Leavitt finds her role in the movie and her new job to be rewarding by inspiring young men and women, particularly young girls "to follow their dreams" and "reassure them that they can accomplish more than they probably realize if they just work hard and are determined."
“For it to finally come out and to get glimmers of seeing young girls excited, its everything to me," Larson told ABC's Nightline. "I didn’t make this movie for myself, I made it for them.”
That young audience will be able to see the Air Force's female superheroes at every theater screening of the movie.
Playing before screenings of Captain Marvel will be an Air Force recruiting commercial that shows the Air Force’s 80 female fighter pilots, including Leavitt, at Edwards Air Force Base in California. There are about 850 female pilots in the Air Force.
Ranging in rank from a lieutenant to a three-star general, the filming of the commercial was the first time that all of the Air Force’s female fighter pilots had come together.
The commercial also shows how their numbers have grown since 1994 when there were 315 female pilots in the Air Force including 7 female fighter pilots.
Both ABC News and Marvel Studios are owned by Disney.