Toward the beginning of Ava DuVernay’s movie “Selma,” four little girls in starched dresses are walking down the steps that lead downstairs from the balcony of their church. They are talking about girlish things. “I got my hair pressed that morning, and it was wasted when I hit the water,” one of them says, telling a story about being pulled between the incompatible pleasures of a new hairstyle and a swim on a hot day. The conversation turns to Coretta Scott King’s immaculate tresses. “She parts it in the middle,” another child notes approvingly, longing for the same elegance.

I know my history. I knew the moment I saw those four little girls that they were about to die violently in the 1963 bombing of the 16th Street Baptist Church in Birmingham, Ala. But DuVernay staged their chatter, and their passage down the staircase, bathed in pale, clear light, in a way that lulled me. For a moment they were so vibrantly alive that I forgot the fate that was descending on them. And when the explosion ripped through that staircase, like a beast lunging in from the right side of the frame and leaving a swirl of splinters and patent leather shoes in its wake, I was shocked in spite of myself.

“Selma,” which chronicles the campaign for the Voting Rights Act, has its virtues — including an excellent cast — and its weak points, most notably some leaden scenes that consist of bullet-point summaries of the range of opinions included under the umbrella of the civil rights movement. It is at its absolute best, though, when “Selma” uses the techniques of a genre that is decidedly less respectable than glossy biopic. In the Birmingham church bombing sequence and several others, DuVernay does a masterful job of communicating the terror of finding yourself the target of racist violence. “Selma” is history as a horror movie.

This approach shows in DuVernay’s staging of Bloody Sunday, so named for the attack that state troopers and members of Alabama posses perpetrated on marchers who tried to cross the Edmund Pettus Bridge on March 7, 1965. As the protesters — including future congressman John Lewis (Stephan James) — neatly attired in suits and church clothes and carrying small bags of the supplies that are meant to carry them from Selma and Montgomery, approach the bridge, the camera pauses on the letters that spell out its name. Rust is streaking down from the signage onto the pale metal of the structure. The Edmund Pettus Bridge appears to be bleeding.

On the other side of the bridge, a member of a posse winds barbed wire around a bat, the camera gliding past this ominous image as if it’s not worth lingering on. Rather than letting us keep our wary eyes on the weapon, the frame moves on to other things, distracting us and leaving us exposed to a sneak attack from that wire and wood. The state troopers pack their humanity away behind gas masks. The smog pours across the bridge. The dark line of a whip cracks up straight into the air before whistling down on a human being. As a girl runs away from the sting of the gas, an officer emerges from the rolling cloud to beat her. John Lewis looks up after having been knocked to the ground and sees a baton coming in at him.

Over and over again in the Bloody Sunday sequence, DuVernay creates striking images of monstrous things emerging from the blankness. But the most impressive thing about the violence she stages is that DuVernay is not putting us in the position of passive observers to the brutalization of others. Often, she’s staging shots to give us the experience of being bashed in the face.

The most powerful of these moments comes in the movie’s first act, when, after the police break up a small nighttime march, Jimmie Lee Jackson (Keith Stanfield), his mother, Viola (Charity Jordan), and his grandfather, Cager Lee (Henry G. Sanders) escape down an alley. For a moment, it seems that they have saved themselves, that the police are so busy beating other marchers that the Lees have gone unobserved. Even if the cost of their safety is high, we feel profound relief for them.

But that peace is shattered when an officer in a white helmet shoots into the frame and takes off after the Lee family at a run. The anticipation that follows is dreadful. The Lees try to disguise themselves again by taking seats in a restaurant, Cager’s hands shaking too badly for him to camouflage himself as an ordinary patron in search of a meal. As we know it will, this ploy fails, too. The police burst in, beating the patrons in utter disregard of the unwritten laws that make even the humblest restaurant a civilized place, until finally the crack of a gunshot slams Jimmie back against the wall.

DuVernay has given us a plain and painful illustration of what it means to live under deadly threat. An environment in which murder at least puts an end to agonizing uncertainty and perpetual fear is utterly distorted and profoundly inhumane. “Selma” communicates at a visceral level a point many observers have been trying to make in a series of recent national conversations: what it means to live in constant fear of death or violence for which there will be no justice.

After Jimmie’s death, DuVernay also helps us to reckon with what it means to survive the coming to pass of your worst fears. A meeting between the Rev. Martin Luther King Jr. (David Oyelowo) and Cager Lee at the morgue where he has gone to identify his grandson’s body is the most powerful scene in “Selma,” and an important counterpart to the end of “12 Years a Slave.”

In that movie, Solomon Northup (Chiwetel Ejiofor), a free man sold into slavery, finally is freed from bondage, but he must leave behind Patsey (Lupita Nyong’o), who has no champions in the free world to liberate her. Their owner, Edwin Epps (Michael Fassbender), barely recognizes the authority of the man who has come to collect Solomon and bring him home: If Solomon waited to leave or tried to advocate for Patsey, Epps might decide not to let either of them go. Solomon must seize his chance. After hugging Patsey farewell, Solomon gets on a carriage and wrenches his eyes away from the woman for whom he can do nothing. The scene is a terrible reminder that our progress toward freedom is often deeply compromised and bought at great cost.

And in “Selma,” King tells Lee, “There are no words to soothe you.” King is acknowledging that even if he and his allies manage to achieve Jimmie’s dream of the reforms that would allow Cager Lee to vote (and at the end of the movie, we learn that they do), they cannot bring Jimmie back from the dead. The victories that civil rights movements win can change the future. They cannot undo the injuries and tragedies of the past.

The great pleasure of most horror movies is that they frighten us, and then release us out into the comparative safety and normalcy of the real world. Biopics function the same way, reassuring us that various cruelties are permanently confined to the past. But even if their numbers are depleted and their sanction from the state is less certain, the monsters Ava DuVernay depicts in “Selma” are still with us.