Three years ago, when the Tsarnaev brothers set off a bomb at the finish line of the Boston Marathon, killing three people and wounding two hundred and sixty-four, Craig Atkinson, a New York filmmaker, looked on with as much horror as anyone else. But he noticed something, too: the police in Boston and its suburbs sent armored cars into the streets and deployed officers dressed like Storm Troopers, who carried assault rifles and fanned out across neighborhoods as though they were in an infantry division in Afghanistan. Atkinson asked himself, when did local police forces, in their equipment and tactics, come to resemble armies of occupation?

The answer Atkinson came up with is “Do Not Resist,” a documentary film that traces the transformation of police departments across the United States into forces that often look like our Army and Marines—and all too often act like them. Watching “Do Not Resist,” which won the prize for best documentary at the Tribeca Film Festival last month, is an eye-opening experience. The film takes a series of events that might appear unrelated—the heavy-handed police response to the demonstrations in Ferguson, Missouri, in 2014; the use of heavily armed SWAT teams in South Carolina to carry out routine drug arrests—and shows that they are part of a pattern that has taken hold in many police departments across the country. “What we discovered is that the there had been a massive change in the tactics used by SWAT teams,” Atkinson told me. “And that happened as the federal government was giving away military equipment to police departments.”

Atkinson is not the first person to detail the militarization of America’s police. The Times, the Washington Post, USA Today, and the Marshall Project did it earlier. But by providing a visual account of how police forces across the country have changed—and how they are using the extraordinary weapons they’ve been given by the Pentagon—Atkinson has performed a public service.

“Do Not Resist” features several eye-popping moments. There’s Dave Grossman, a leading consultant to police and the F.B.I., lecturing a room full of officers on the pleasures of using violence on the job. (“Finally get home at the end of the incident and they all say, ‘The best sex I’ve had in months,’ ” Grossman told them.) There’s the scene, in South Carolina, of the Richland County Sheriff Department’s Special Response Team conducting a practice gun battle, firing automatic weapons and looking very much like the Navy SEALs in Baghdad. And there’s Alan Estevez, a deputy under-secretary of defense, testifying to Congress that, along with the many tons of military equipment, police departments were in recent years given twelve thousand bayonets.

The practice of donating unused military equipment to local governments began in 1997, when language creating a program for it was included in an otherwise unremarkable Defense Department budget authorization. Under the 1033 program, as it’s called, the Department of Defense publishes a list of surplus equipment that is available to local governments. But the turning point—as with so many other issues—came after 9/11. Since the nineties, the Defense Department has donated some five billion dollars’ worth of equipment—much of it non-lethal items, like office supplies—to local governments. But the over-all value of military equipment acquired by police forces is actually much higher: local governments have received approximately thirty-four billion dollars in grants from the Department of Homeland Security to buy their own military equipment from private suppliers. That brings the total to thirty-nine billion dollars—more than the entire defense budget of Germany.

The 1033 and Homeland Security programs have resulted in local governments around the country acquiring an astonishing range of military equipment, including armored personnel carriers, M-16 assault rifles, grenade launchers, and infrared gun sights, all of which were designed for combat. Among the vehicles routinely given to police departments is the MRAP—mine-resistant, ambush-protected vehicle—which can weigh up to about twenty tons and is designed to survive roadside bombs. According to the Marshall Project, some six hundred MRAPs have been doled out to local governments around the country; they cost about a million dollars each.

The Marshall Project has broken down the Defense Department’s donations by county and city, so you can look up what military equipment your local police department has received. It turns out that New York City has acquired surprisingly little under the 1033 and Homeland Security programs: just a pair of armored personnel carriers and some other non-lethal gear. The sheriff’s department from my home town, in Brevard County, Florida, scored big, getting its hands on nearly seven million dollars’ worth of equipment, including thirteen helicopters, two armored personnel carriers, and two hundred and forty-six assault rifles. In 2014, the Los Angeles Unified School District announced that it would return the three grenade launchers it had acquired from the Defense Department but would keep its armored personnel carrier and sixty-one assault rifles.

“Do Not Resist” shows a city-council meeting in Concord, New Hampshire, during which the members vote overwhelmingly to accept a two-hundred-and-fifty-thousand-dollar federal grant to buy a BearCat armored vehicle from a private supplier. (Concord, population forty-two thousand, has recorded two murders since 2004.) During the debate, a resident holds up a sign that reads, “More Mayberry, Less Fallujah.” Another Concord resident tells the council members they’re making a mistake: “Terrorism works because it makes people irrational and it makes them destroy themselves.”

As the Pentagon was doling out free military equipment, something else was happening, too: there was explosive growth in the use of SWAT teams, which were often armed with the same military equipment that was obtained from the federal government. According to Atkinson’s reporting, SWAT teams were deployed about three thousand times a year across the country in the nineteen-eighties. By 2005, they were deployed forty-five thousand times a year; in 2015, more than fifty thousand times. In one of the film’s most poignant scenes, the Richland County Sheriff’s Department deploys its Special Response Team to raid a home in a run-down neighborhood where the inhabitants were suspected of keeping marijuana. The team members, who are dressed for full combat—black fatigues, helmets, and assault rifles—smash the doors and windows, enter the house, and arrest the owner’s son. They seize eight hundred and seventy-three dollars in cash from him, which he tells police he needs to run his landscaping business. They end up finding a gram and a half of marijuana—enough to fill about a teaspoon. The suspect’s mother, who is in the house at the time, is not arrested. “They tore down the house,” she tells the filmmakers. “My son went to jail for a gram and a half that they shook out of a bottom of a book bag.”

Atkinson told me that the raid in South Carolina was typical of the half dozen he went on with police and sheriff’s officers across the country. For all the military equipment and tactics that were used, very little in the way of criminal activity was ever discovered. “We kept going out, but we never found much of anything,” he said.