The first fiction feature by director Gabriela Cowperthwaite (“Blackfish”) is essentially a girl-and-her-dog story, but a fact-based one in which the girl is a Marine and the dog her weapon-sniffing partner in war-torn Iraq. After both are injured by a roadside bomb, they are nursed back to health, but a sourpuss veterinarian (Geraldine James) concludes that Rex, the heroic German Shepherd, is unsuitable for adoption because of his aggressive tendencies, and broken-hearted Megan Leavey (Kate Mara), now a civilian, must wage a seemingly hopeless campaign against the military establishment for the right to do so. That’s the sum and substance of the picture, which boasts a reasonably interesting first third and some strong wartime footage, but gets drippy and sentimental in the last act.

Leavey is introduced as a disaffected young woman in her upstate New York hometown, living with her shrewish mother (Edie Falco) and her layabout stepfather (Will Patton) while her dad (Bradley Whitford) spends most of his time working. Unable to hold down even a menial job because she lacks “people skills,” she abruptly decides to enlist in the Marines and is quickly sent for basic training. But she’s no more competent there than she was in civilian life, and finds herself assigned to the humiliating duty of cleaning up the kennels that house the squad’s warrior dogs. The most aggressive of them, Rex, terrifies her, but with help from company commander Gunny Martin (Common) and an experienced handler back from a tour in Iraq (Tom Felton), she overcomes her fear, joins the trainees and bonds with Rex. Soon the two are on the way for a tour of duty in the Middle East.

The in-country portion of the film is certainly its strongest element. True, the cutesy semi-romance that Megan develops with fellow dog handler Matt Morales (Ramon Rodriguez)—despite the fact that he roots for the Mets and she for the Yankees—is laid on awfully thick. But the actual footage in the field generates considerable tension, and the final mission that concludes with Megan and Rex both injured is very well staged.

Leavey’s return stateside, and her efforts to adopt Rex despite the mound of red tape standing in the way, are unfortunately less skillfully handled, coming across as the sort of manipulative uplift that one usually encounters in made-for-cable TV dramas, down to an impromptu meeting with Senator Chuck Schumer (played by an actor who looks nothing like him) on the steps of the Capitol and a recreation of a Yankee Stadium reception.

Even here, however, Mara teases out the various facets of Leavey with exceptional finesse; it’s easily her best performance to date—though one shouldn’t overlook the contribution of the dogs (the most prominent a canine called Varco) to the mix. Whitford, almost unrecognizable at first, delivers a nice cameo as her supportive dad, and though Falco comes on a bit too strong, she at least adds intensity to her scenes (something that Patton, exuding cheerful weakness, does not). Rodriguez, Felton and Common are all effective, and though the picture is obviously not a big-budget effort, it is technically more than adequate, with cinematography (by Lorenzo Senatore), production design (by Ed Verreaux) and editing (by Peter McNulty) that work well together, especially in the Iraq sequences. Mark Isham’s score is predictable but professional.

Dog fanciers and will undoubtedly find “Megan Leavey” a satisfying tearjerker, and its patriotic spirit will appeal to many as well. It’s really not much more than a Hallmark Hall of Fame-style exercise in audience manipulation, but it’s a better-than-average example of the type.