If not for the real-life footage that bookends Peter Berg’s adaptation of Marcus Luttrell’s nonfiction bestseller, Lone Survivor would come close to tipping right into another hero-worshipping chronicle of the special-operations soldiers so beloved by today’s Xbox-playing couch warriors. But the story hasn’t even begun and already Berg has you immersed in images of SEAL trainees getting systematically broken down to the point of tears. Before the choppers rev up and the men fly off into the Afghanistan mountains to go Taliban-hunting, you’ve already witnessed the limits they have been pushed to.

Berg, who also scripted, first provides a few brushstrokes of character. It’s 2005, Bagram Air Force base, awash with alpha-males. Berg zooms us in quietly on the four protagonists, crafting personality without tricks: mellow Danny Dietz (a surprisingly credible Emile Hirsch), the more high-tension Michael Murphy (Taylor Kitsch) and Matt Axelson (Ben Foster, stupendous), and Luttrell himself (Mark Wahlberg, also a producer). There’s a scene of razzing the new guy which initially plays as straight comic relief but then detours skillfully into the recitation of the team’s code—“Never shoot a large-caliber man with a small-caliber bullet. Anything in life worth doing is worth overdoing.” That, along with Wahlberg’s narration about how “there’s a storm inside of us…burning” further cements the sensation of being in a tight, hermetic world where loyalty is paramount, limits are there to be gone beyond, and just about everything else can go hang.

The mission that drops the four SEALs onto a mountain slope near the Afghanistan-Pakistan border (New Mexico standing in very credibly) has them monitoring a village where a Taliban warlord is camped out. Trouble getting a signal out sends the men up and down the slopes until they run into some Afghan shepherds and are faced with a dilemma. Shoot the men so they can’t alert the Taliban, tie them up and leave them possibly to starve to death, or let them go and hope to get evacuated in time. After a brittle exchange weighing the pros and cons (if discovered, the first two options break their rules of engagement and would be a public-relations disaster), Murphy orders them to let the Afghans go. In short order, they’re surrounded and fighting to the death with none of the accustomed leveling factors (air support, artillery). The idea that they could have saved themselves by killing civilians is never spoken, but it reverberates throughout the rest of what happens.

The body of Lone Survivor is the long, savage firefight between the SEALs and the Taliban who swarm up on them once the word gets out. Berg’s strict and realistic handling of the combat is some of the best ever seen on film. It works in smartly delineated levels that mimic the SEALs’ increasing panic. Crack shots and heavy with ammunition, they can initially pick off their enemies with calm precision. But there’s a turn when the Taliban suddenly take the high ground and start pushing the SEALs down the mountain with an unrelenting stream of AK-47 and RPG fire. After that, Berg’s tightly framed camera picks out the steady degradation of these seemingly invincible warriors, as they are pushed into worse and worse positions, take round after round, and start realizing they might not be going back. The look in their eyes is that of worlds coming undone and it’s terrifying.

A stranger-than-fiction third act puts an incredible cap on the action with its mixture of out-of-nowhere tragedy and incredible, unlikely heroism. It also makes Lone Survivor the rare Afghanistan or Iraq war film that acknowledges civilians as not just victims or potential enemies but people with their own purpose and moral code.

Berg shoots fast and clean, without a bombastic score or too much attention-grabbing slow-motion. One shudders to think what Ridley Scott would have done with it. The dialogue is clipped and tart, mostly without bravado. There’s a cynicism that could have come out of a William Wellman film (“If that’s God looking out for us, I’d hate to see him pissed”). He wrings striking performances from everybody involved, particularly Foster, who manages to be both feral and big-hearted at the same time. All in all, it nearly makes up for the stupefyingly misguided Navy commercial that was last year’s Battleship.

Like at the film’s start, Berg brings us back to reality before the credits. The stills and footage of the American dead, all those smiling faces now gone, somehow manage to make what preceded even more devastating.