“It’s a miracle to realize that somebody loves you.” So writes James Baldwin in his 1974 novel, If Beale Street Could Talk, which has been carefully and handsomely translated to the screen by the director Barry Jenkins. Baldwin tells his story of brute injustice with piercing, sometimes angry prose: A man from Harlem named Fonny (played in the film by Stephan James) is imprisoned for a crime he says he couldn’t have committed, and his girlfriend, Tish (KiKi Layne), and the couple’s families work to secure his release. But Beale Street is also an ode to a neighborhood and a wider community that helped foster Fonny and Tish’s deep connection in the first place.

There’s no director better equipped than Jenkins to match Baldwin’s precise mix of polemic and passion. Moonlight, Jenkins’s last movie, was a meditation on love and heartbreak that simmered with rage and regret; it immediately announced the filmmaker as a major talent (and won a surprise Best Picture Oscar to boot). If Beale Street Could Talk, the first fiction-movie adaptation of a Baldwin novel, would have been an ambitious task for any director. But Jenkins knows to focus on the profound link between the two young lovers, building the rest of the story out from there. With Beale Street, he has crafted one of the year’s most resonant films.

Fonny, who has been Tish’s friend since childhood, is in jail awaiting trial on a charge of rape. Because his accuser, who picked him out of a lineup, has fled back home to Puerto Rico, the case has become a matter of Fonny’s word against that of a bigoted policeman (Ed Skrein). As the film begins, Tish breaks some big news to her and Fonny’s families: She’s pregnant, making the need to fight for Fonny’s release all the more urgent. The first part of Beale Street is surprisingly heightened and darkly comic, as Tish’s more understanding parents, Sharon (Regina King) and Joseph (Colman Domingo), clash with Fonny’s intensely religious mother. The opening act is a bold introduction to a movie that vacillates in tone without losing hold of its central message.

As Baldwin’s story (and Jenkins’s screenplay) hops from timeline to timeline—jumping to the swooning past and flashing back to the sober present—Tish and Fonny’s love for each other is a necessary, grounding constant. In the past, they’re discovering each other as romantic partners and working to build a life together in a cheap studio downtown. In the present, they’re separated by a pane of glass whenever Tish visits Fonny in jail; she tries to assure him that things will be okay, while he tries to conceal his growing despair.

Jenkins understands how tempting it can be to yield to the pull of futility, but he strives to uncover glimmers of hope as the obstacles pile up. Layne’s and James’s performances sparkle with humor and personality in even the toughest moments; the same goes for the rest of the fabulous ensemble, including King, Domingo, and a fiery Teyonah Parris as Tish’s sister, Ernestine. The cinematography, by Jenkins’s longtime collaborator James Laxton, is painterly and luxurious, bathing Harlem in color and light. The score, from Nicholas Britell, uses tremulous strings and horns to sound a nervous wail.

Though Baldwin’s novel is short, it could’ve been tricky to adapt into a film because of its teeming contradictions: Beale Street is furious, sad, and cynical, but also soaring, loving, and at times genuinely delightful. As a director, Jenkins is confident enough to let the tenor of the story shift wildly. So while a showdown between Tish’s and Fonny’s families edges into slapstick territory as the two mothers scream at each other, it also takes a sudden scary turn into physical violence. Other moments can be still and somber, as when Daniel (Brian Tyree Henry), Fonny’s friend who was recently released from prison, delivers a powerful monologue on the dehumanizing horrors of the place he just left.

While Moonlight was aided by a very clear story structure (it chronologically followed three periods in its lead character’s life), Beale Street meanders. It winds its way to a conclusion that feels definitive and open-ended at once, asking questions of the viewer and not entirely giving in to either optimism or pessimism. But that approach helps Jenkins tell a fuller story, one about a couple in a frightening situation, but also one about how they draw strength from their loved ones and from the intimate spaces they’ve cultivated. If Beale Street Could Talk is an impressive, mature, and determined work that ably reaches the great heights it sets for itself.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.

David Sims is a staff writer at The Atlantic, where he covers culture.