The social media uproar over Joseph Kony, the leader of the so-called Lord’s Resistance Army, and his employment of child soldiers has apparently subsided, but the reality was always far wider than a single monster, and Cary Joji Fukunaga’s adaptation of Uzodinma Iweala’s 2005 novel portrays it in starkly powerful terms. “Beasts of No Nation” is set in an unnamed African country but was shot in Ghana, and apparently it features some Ghanaian Twi dialects in the dialogue. But it probably reflects episodes that could have occurred in Nigeria, though the only Nigerians to appear in the narrative are peace-keeping troops.

The focus of the story is Agu (Abraham Attah), a pre-teen boy who leads a relatively agreeable life with his family—his father (Kobina Amissah Sam), a teacher, and his stern but loving mother (Ama K. Abebrese), along with his fun- (and skirt-) loving older brother (Francis Weddey) and a young sister (Vera Nyarkoah Antwil)—in an enclave protected from warring factions (a recently installed military junta and an army of rebels) by the foreign peacekeepers. The relative calm is shattered, however, by rebel advances that force the men to send the women and children away to hoped-for safety while they remain behind in their village. The arrival of government soldiers proves no salvation, however; they declare the locals spies for the enemy and summarily execute them. Only Agu escapes.

He soon falls in with a battalion of rebel forces led by the Commandant (Idris Elba), whose combination of charisma and brutality keeps his troops, many of them child soldiers, in awe. The Commandant initially places Agu under the thumb of one of his lieutenants for training, but gradually takes him directly under his wing, and eventually initiates the boy into his squad’s murderous ways: after an ambush of a government convoy, he prods Agu to kill a captured engineer with a machete, telling him that the man is one of the enemy that murdered his father and implying that he has assumed the role of a surrogate parent. It’s a sequence that’s compelling not just for the violence, portrayed in a gruesomely realistic fashion, but for how it makes Agu’s conversion to his new role horribly comprehensible.

The film then follows the course of the squad’s progress as it takes village after village, with the Commandant rousing his troops into acts of exuberant self-sacrifice and wanton viciousness through a mixture of threats, cajolery and near-mystical ritual. But it also paints the Commandant as a complex figure, occasionally bristling at orders he receives from his superior or giving hints about his own background. It also suggests, rather than showing specifically, how he takes advantage of his young recruits sexually—not only Agu but the mute Strika (Emmanuel “King Kong” Nii Adom Quaye), with whom Agu develops an especially close bond.

The final act of the picture, unfortunately, shows decreasing energy as the squad is ordered to the rebel capital, where the Commandant’s more politically savvy superior (Jude Akuwudike) tries to demote him, naming him to a so-called security position and passing control of the squad to a lieutenant who’s been showing signs of misgivings over the Commandant’s bizarrely brutal style. That leads the Commandant to stage what amounts to a clumsily staged coup in which his successor is killed and he leads the squadron back out into the field to fend for themselves. It’s a tactic that doesn’t work, and they find themselves isolated and under attack from all sides. Eventually Agu and the few stragglers who have survived along with him must decide whether to continue following the Commandant blindly or surrendering. A final sequence offers a glimmer of hope for children who suffered Agu’s fate while suggesting how difficult the work of reclaiming those like him for a civil society will be.

One has to credit Fukunaga’s courage in undertaking to bring such challenging material to the screen—though he tackled no less demanding a subject in his first feature, “Sin Nombre,” about young refugees from Honduras and Mexico desperately trying to journey to the U.S. Serving as cinematographer as well as writer-director, he uses the African locations to striking effect and secures remarkable performances, not only from Elba, who manages to suggest hidden layers in a character that might have been played as a one-note monster, but from newcomers Attah and Quaye, whose wide-eyed vulnerability as Agu and Strika this African Fagin exploits in heartbreaking fashion. One also has to admire Netflix, whose first theatrically-released feature this is, for bankrolling such a risky project, which might frighten off its own subscribers.

“Beasts of No Nation” is undeniably hard to watch, but also a dramatically wrenching depiction of contemporary realities one might prefer to ignore—but shouldn’t.