Moffie, screening in the Orizzonti sidebar at Venice, is a tense, stealthy rites-of-passage drama from the dog days of South Africa’s apartheid regime, a tale of callow young conscripts inside a corroded old system. Set in 1981 during the country’s border conflict with communist-backed Angola, Oliver Hermanus’s film manages an unflinching portrait of a society in spasm; paranoid and brutish and largely screaming at itself. It’s a war story of sorts in which the battle has already been lost.

Kai Luke Brummer gives a fine performance as Nicholas, a willowy 18-year-old at a sun-blasted army boot-camp. Nick and his fellow soldiers are supposed to be fighting the enemy, but the only action they’re seeing is on the volleyball court, or the dorm, or sometimes in the toilet cubicle, much to the sergeant’s horror. The way the officers see it, the very worst thing a soldier can be is a “moffie”, an Afrikaans insult that the subtitles translate as “faggot”. “Moffie!” they scream – as though they regard homosexuality as a mad dog that has somehow got under the fence, or an invading swarm of wasps, liable to sting any man who isn’t properly covered up.

Nick has a porn mag, which surely means he’s protected. But he’s also drawn to handsome, sophisticated Staffen (Ryan de Villiers), who helps him dig a trench. But men have orders to remain in the pit until dawn. It’s cold and it’s wet. They’re only snuggling up to keep warm.

Facebook Twitter Pinterest Tension … Kai Luke Brummer and Ryan de Villiers. Photograph: Daniel Rutland Manners

Hermanus, a black South African film-maker, has said that he initially balked at the prospect of making a film about the plight of his nation’s white minority. But he was swayed by the power of Andre-Carl van der Murwe’s memoir (Moffie’s source material) and by an unexpected sense of kinship with the desperate duo at its centre. Without ever glossing over South Africa’s culture of institutionalised racism, Hermanus suggests that its rampant homophobia is creating its share of casualties too.

Staffen, for starters, will not be tolerated. “He’s a piece of shit,” says the sergeant; he’s contaminating the barracks. But after the boy is shipped off for re-education, Nicholas is left turning in circles, exposed beneath the big bruised skies, only dimly aware that he is about to be deployed. Meanwhile Moffie maintains its own holding pattern, ratcheting up the tension and wringing optimum menace from the conscripts’ simmering levels of boredom as Braam du Toit’s superb atonal soundtrack hints at mounting psychological unease. Hermanus favours handheld cameras, brought in so close to the actors that every sudden movement, however mundane, carries the threat of violence and you’re never entirely sure whether somebody is about to be punched or kissed – nor which outcome would be the more disastrous.

Moffie is measured, remorseless; it crawls right under your skin. By the time these virgin soldiers are removed from the barracks, sent into the rushes where the enemy lies in wait, it almost comes as a sweet relief.