This is an archived article that was published on sltrib.com in 2017, and information in the article may be outdated. It is provided only for personal research purposes and may not be reprinted.

As a documentary filmmaker, Gabriela Cowperthwaite had worked on a History Channel series about the lives of Marines. But one perspective was missing.

"All those years we were doing those documentaries, we never interviewed a single female Marine," Cowperthwaite said. "I was very curious about how a woman comes up in that world, in the military world."

For her first feature film, "Megan Leavey" (opening nationwide Friday), Cowperthwaite tells the story of a Marine whose work as half of a canine explosives-detection team saved countless lives in Iraq.

"It's a story about wartime, but it's a story about a bond," Cowperthwaite said in a recent phone interview. "It's a very unique brothers-in-arms bond, but neither character is a brother. It's a dog and a female."

Megan Leavey, a corporal when she left the U.S. Marine Corps, was mounting a media campaign to urge the Marines to let her adopt her dog partner, Rex, when movie producers came calling.

"They heard about my story when I was in the process of trying to get Rex back, after he'd gotten sick, in 2012," she said in a phone interview.

The movie chronicles Leavey's life before, during and after her Iraq War experience. It shows her as a college-age woman in a town outside New York City, after being fired from another dead-end job, and deciding to join the Marines.

Leavey said her decision to enlist was, in part, inspired by the attacks on 9/11. "That really hit home for me," she said, adding that she chose the Marines because "if I'm going in, I'm going all in. … If I'm going to join, I'm going to join the toughest one."

Her intention was to be in the military police, but she switched to canine training at Camp Pendleton, Calif. It's a demanding job, working in partnership with a dog to locate IEDs, land mines, weapons caches, and anything else that might go boom. Leavey and Rex saved countless lives by finding explosives before they went off.

Leavey, Cowperthwaite said, "doesn't like to talk about all these people she saved. She says 'we,' and she includes all service people when she talks about her service. It's all about the team. It's very Marine Corps, but it's also very Megan."

The script for "Megan Leavey" was given early on to Kate Mara, who starred in "The Martian," "Fantastic Four" and, perhaps most familiarly, as an ambitious reporter who met a bad end on Netflix's "House of Cards."

"It was so a no-brainer, really," Mara said of taking the role. "I've never been sent a script about a female Marine before. It's rare that those stories are made. And her story, specifically, was so beautiful."

Mara met Leavey in New York, while Mara was doing publicity for "The Martian," and hit it off quickly. "We're both sports girls," Mara said. (Leavey, a lifelong New York Yankees fan, recently started working for the Yankees organization. Mara has the NFL in her DNA: Her father's family founded the New York Giants, and her mother's family founded the Pittsburgh Steelers.)

"The first time we met was really just this awesome experience," Mara said. "She just made me feel at ease. We really had her support in making this movie, which just makes you want to tell the story that much more."

Mara, Leavey said, "has this huge love for animals like I do — she has two dogs, and I have my dog — so that is genuine. She was excited to work with a dog."

Mara also picked up some of Leavey's mannerisms. "My friends say, 'She sounds exactly like you, it's creepy,' " Leavey said.

Mara's interest in animal rights connected her to Cowperthwaite, who directed the documentary "Blackfish," an exposé of practices at SeaWorld that stunned moviegoers at the 2014 Sundance Film Festival.

Cowperthwaite joins a growing list of female directors — along with Patty Jenkins ("Wonder Woman"), Stella Meghie ("Everything, Everything"), Robin Swicord ("Wakefield") and Sofia Coppola ("The Beguiled") — with major releases on this summer's schedule.

Having a woman direct "Megan Leavey," Cowperthwaite said, "is hugely important. This story lives in the in-betweens. It's hard to describe, but the story lives in the nuances and in watching [Megan] slowly bond with this animal. … I think women can do nuance pretty well. … We've all been her. We've all lived through versions of Megan."

Leavey said she hopes moviegoers "see more of a personal story, not just a war story."

"It wasn't a quick thing for me to get Rex back," she said. "I just never gave up. It's hard not to give up on something for four years. … I just hope people see that about me, that they don't give up on something they love. If something means that much to you, stick with it."

Twitter: @moviecricket