Among today’s action filmmakers, Peter Berg is the stand-up triple guy. He has patience to pick a pitch worth the swing, the power to pound it into the corner and the legs to run like hell. And even if he just ends up blooping one into the outfield (Battleship) or gets picked off at second (Hancock), he’s always worth watching.

For all of Berg’s consistency, he has yet to fully round the bases. But he certainly comes closest with Lone Survivor, an appropriately harrowing, horrifying and humbling war film. It’s a longtime passion project of his, financed by Universal only after he agreed to direct Battleship for them. (Ironically enough, this film is likely to make more money stateside than that winking and loopy, but costly, bomb.)

It’s based on a book of the same name by Marcus Luttrell (played by Mark Wahlberg), a former Special Warfare Operator, Second Class (SO2) Navy SEAL and the only one of a four-man ground team to survive 2005’s Operation Red Wings.

For Luttrell, fellow SO2s Danny Dietz (Emile Hirsch) and Matthew “Axe” Axelson (Ben Foster) and Lieutenant Michael P. Murphy (Taylor Kitsch), the mission was to capture or kill Ahmad Shah, a Taliban-connected military leader, near a small Afghanistan village.

An impromptu improvement of their perch on a heavily forested mountain choked off their communication with commanders back at Bagram Airfield. And after choosing to set free a group of shepherds who discovered the team — among them a young boy — more than 100 Taliban warriors descended upon the soldiers.

As the men swiftly debate what to do about the shepherds, Lone Survivor understands that the armchair agenda is as much a part of modern warfare as combat. “It’s no one’s business what we do out here,” responds Axelson to Luttrell’s insistence of a PR nightmare (and raised ire to murder fellow servicemen) if three dead bodies are found. “It’ll be all over CNN,” Luttrell says. “ ‘SEALs kill kids.’ ”

Strategy is great in the barracks, but there’s little room for “if-then” philosophizing before imminent gunfire. Lone Survivor knows a foe’s choice to abide by your rules of engagement is a roll of karmic and moral dice, and the arrival of cavalry is equally left to chance. It also never pauses for finger-pointing arguments among the men, who, if they are to live (or help the others do so), must accept one choice and then make dozens more.

So, for more than four hours, these four men exchanged gunfire with the Taliban, constantly repositioning themselves in terrain as mercilessly unforgiving as the men advancing on them. Only after a group of Pashtun villagers escorted Luttrell to safety, themselves warding off Taliban incursions afterward, was he treated and sent home.

An easy knock against any film honoring American servicemen is that, by default, it celebrates combat and beckons the young with deceptively patriotic ooh-rah. Folks, we’re an extremely weary world away from the oiled-up volleyball games of Top Gun.

What befell these SEALs could only seem appealing to someone with a strangely specific death wish to die slowly, violently and, ultimately, alone on a desolate mountain halfway around the world. It neither rejoices at the Taliban slaughter nor paints the Americans whom they killed as jingoistic martyrs.

If Berg has obvious respect for the loudest, darkest, coldest and most unpleasant fights these SEALs chose to face, he also recognizes military service is often a door through which many men and women walk just once. (Back at the base, SEALs’ names are written in chalk next to their bedrooms’ plywood doors — an undoubted bit of authenticity but also a subtle inference to the interchangeability of troops.)

“Lone Survivor” more easily avoids charges of propaganda that befell 2012’s unfairly maligned Act of Valor (an engrossing, if flawed, actual SEAL-starring spin on a traditional procedural). But the presence of recognizable actors doesn’t offer the comfortable detachment of entertainment here, and it’s not meant to.

Not since Black Hawk Down has a film so vividly and wrenchingly conveyed combat’s bodily horrors. In an uninterrupted 35-minute sequence, Berg holds nothing back in his blunt-force depiction of SEAL Team 10’s bravery and willpower.

New Mexico’s mountains stand in for a brambly hell that eroded these men little by little as they were forced to hurtle themselves into one treacherous alcove after another. Cheeks are gouged open. Rocks bend ankles into appalling angles. Bones splinter through skin. Parts of their heads become concave craters. Bullets graze and pierce flesh. Purposefully terrifying sound design amplifies their death-rattle wheezes and the sickening slosh of blood in their lungs. (The falling sequences alone are yet another exhibit for the case to recognize stunt performers at Oscar time.)

So viscerally immersive is Berg’s direction and Tobias Schliessler’s cinematography that even the thought of moving a few paces seems foreboding and grim. But as long as they have one good leg on which to stand, one eye to spot their enemy and enough fingers to pull a trigger, the men, as they say, are “solid.”

Part of Wahlberg’s appeal here, and in much of his acting career, is that he’s a believably everyday guy. Kitsch and Hirsch mute their charisma to match him with something equally serviceable. Much of that has to do with Berg’s script, which does little to distinguish this quartet’s camaraderie from usual warrior-code shorthand.

However, Foster, an underrated chameleon of a character actor, delivers tremendous work as Axelson. In the firefight, his aggression feels like a choice to affirm the life he’s lived in the face of an impossible situation. “I am the reaper,” he says, with the unspoken back half of his sentence “for if I’m not, I’m his quarry.” Even as Axelson’s injuries render him speechless, Foster’s body language and countenance continue to scream full-hearted defiance.

Lone Survivor only stumbles in a third act that feels standardized and sanitized in a way the rest of the film does not. Much as Berg whittled The Kingdom down to whiz-bang efficiency, he beats a retreat to his Hollywood side.

You’ll wish there were more moments between Luttrell and his rescuer (Ali Suliman), fewer suspense-killing subtitles (“Fuck the Taliban!”), fewer mid-’90s-action-movie instances where children conveniently toss weapons, and a resistance to underline an already-effective portrait of heroism with Peter Gabriel’s otherwise outstanding cover of David Bowie’s “Heroes.”

Still, Lone Survivor can be forgiven its artistic license after running a rigorous, exhausting and unshakeable gauntlet of authenticity. It’s not a recruitment tool, it’s a haunting requiem.