In Their Finest, a movie about wartime filmmakers, it's suggested that most stirringly patriotic movies have three ingredients: authenticity, optimism, and a dog.

Megan Leavey has two of those, for sure. It's authentic in that it's the true story of a troubled young woman (Kate Mara) who matures and eventually excels in the Marine Corps, where she trains as a bomb-detection specialist in a canine unit. Enter the dog, Rex, who serves with her in Iraq and Afghanistan, where both were wounded, sustaining trauma that follows them home, where a reunion holds out hope that both can heal.

That sounds like optimism, but Megan Leavey gets a large dose of its authenticity from its unsparing account of Leavey's preservice adult life — adrift and unemployed in a small New York town, living with a mother (Edie Falco) she sometimes resents and stepfather (Will Patton) she despises, wracked by guilt over the overdose death of a close friend.

"Everybody knows the wrong person died," says Leavey, played with just the right note of culpability and introspection by Mara, who separates remorse from self-pity with precision.

One day, fresh from losing another job, she sees a pair of smartly dressed Marines walking into a recruiting office, and in a few days, she is on a bus to boot camp.

Megan Leavey is being sold as the story of the bond between Marine and dog, and that's certainly part of its abundant appeal. But it's integrated into the larger story of Leavey's transformation in the Marine Corps. The guidance, structure, discipline, and accountability she encounters mold her into the kind of person capable of handling a dog like Rex, as troubled and prone to lashing out as Megan.

Initially, they don't get along, Megan's fear is an obstacle.

"Everything you're feeling travels down the leash," explains an instructor (Tom Felton).

He's one of several characters who work to get the best out of Leavey, which becomes a quietly inspiring story of an American institution that actually works. You keep waiting for the scene in which some  sexist bully subjects her to G.I. Jane-level hazing, but it never arrives.

What we get is the opposite. Within the rigid parameters of life in the Corps, her superior officers (including Common) and fellow soldiers (Ramon Rodriguez) help Leavey find confidence, perspective, maturity.

She needs it, to handle a mother who shows up on boot camp graduation day to ask if she has been named beneficiary. And of course it's indispensable in combat, where Leavey and Rex are sometimes "in front of the front lines" finding hidden explosives and marking a path for troops to follow.

It's on one of these missions that both are wounded by shrapnel and concussive shock. Leavey heals physically but returns to New York in a fog, feeling her way out with the help of her patient father (Bradley Whitford) and fellow service members.

Rex, also damaged, is deemed by the Corps to be too dangerous for repatriation, a decision that Leavey fights as she pushes for adoption.

After all that authenticity, a little optimism isn't out of place.

And director Gabriela Cowperthwaite, a documentarian (Blackfish) by training, brings it home with a matter-of-fact clarity and admirable lack of sentimentality. The movie feels honest, and necessary.

You often have the feeling that simple, truthful stories of the men and women who serve overseas are underrepresented on screen. Not this week.


Megan Leavey

Directed by Gabriela Cowperthwaite. With Kate Mara, Common, Tom Felton, Edie Falco, Will Patton, Bradley Whitford. Ditributed by Bleecker Street Media.

Running time: 1 hour, 56 mins.

Parent's guide:  PG-13 (war violence, language, adult themes).

Playing at: Area theaters.