An innocent man is convicted of murder and suffers years of imprisonment before new evidence frees him. Unhappily that story has become increasingly common in recent times—and it’s one that has been depicted in films before, both pure documentaries and docu-dramas. So “Crown Heights” tells a sadly familiar story, but it does so well.

Colin Warner (Lakeith Stanfield) was a teen when he was arrested in 1980 in the titular neighborhood of Brooklyn. An immigrant from Trinidad, he was no saint: he’s shown stealing a car, which he wrecks when his owner chases him down. But he was certainly not responsible for the killing of a black man in broad daylight, as police detectives (the more aggressive of them played by the reliable Zach Grenier) claimed. Nonetheless in 1982 he was found guilty by a nearly all-white jury, along with the brother of a man the victim had earlier shot, on the testimony of a frightened teen (Skylan Brooks) who’d been pressured by the police to identify the shooter after he claimed, falsely, to have seen the killing. The verdict came despite the supposed witness’ stumbling testimony under questioning by the prosecutor (Josh Pais)—and a more spirited defense than such stories usually show from Warner’s lawyer (Nestor Carbonell). The judge (Ron Canada) sentenced him to the minimum possible—fifteen years.

(Matt Ruskin’s script, it should be noted, simplifies this a bit here. There were actually two trials, the second held after the first resulted in a mistrial.)

The opening act of the film, also directed by Ruskin, portrays all this in grimly, grittily matter-of-fact style, though Ben Kutchins’ cinematography periodically employs hand-held camerawork to emphasize the immediacy of the events. That tension continues as Warner enters prison to serve out a term that is extended when he strikes out against an abusive guard. This section of the picture depicts the brutality of his incarceration—and the rigidity of a parole system that refuses even to hear his protestations of innocence—economically, cleverly ticking off the passage of time with inserts of news footage featuring Ronald Reagan, George H.W. Bush, Bill Clinton and George Pataki as they successively made political hay out of “tough on crime” pronouncements.

Gradually, however, the focus shifts to Carl King (Nnamdi Asomugha), Warner’s close friend, who is determined to get him freed even after his initial appeal is rejected. The film goes on to show Warner’s self-training in the law through use of the prison library, and his romance from behind bars with Antoinette (Natalie Paul), a former neighbor who remembers him as a considerate young man. But it centers increasingly on King’s obsession with his friend’s case, which goes so far that it even threatens his own marriage (and bank account) and continues after Warner loses hope once another appeal is bungled. By becoming a process server, King gains access to the legal system, and enlists one of his employers, a lawyer (Bill Camp, excellent) with zeal almost equal to his own, in the search for exculpatory evidence that eventually results in the reversal of Warner’s conviction. The final credits include the obligatory shots of the real people involved, with a remarkably forgiving Warner returned to center stage. (The fact that Warner received $2 million in compensation is not mentioned.)

“Crown Heights” ends with Warner’s release, but it is a scalding portrait of a miscarriage of justice for which it places blame squarely on police and prosecutors willing to resort to the most appalling means to secure easy convictions, a circumstance that, it’s implied, continues into the present (when high bail, overworked public defender offices and a plea bargaining system designed to encourage confessions even when they’re false, are prevalent). It is, however, also a celebration of friendship and commitment in terms of King’s unyielding support—which is connected to the character’s observation that what has happened to Warner could just as easily happen to him. Like Kathryn Bigelow’s “Detroit,” Ruskin’s film may be a period piece—Kaet McAnneny’s production design and Meghan Kasperlik’s costumes reflect that nicely—but it has obvious contemporary resonance.

Stanfield portrays Warner with a simmering intensity that makes his occasional outbursts all the more compelling, and Asomugha brings quiet resolve to King; the supporting cast is also excellent, though some of the authority figures—the cops and guards—are given little shading. Paul Greenhouse’s skillful editing and Mark Degli Antoni’s pulsating score add significantly to the impact.

“Crown Heights” sometimes comes off like a TV docu-drama, but a particularly solid one.