It is not often a three-hour, black-and-white Czech film makes headlines in the British tabloids, but The Painted Bird earned that dubious honour last year. “Sickened film-goers brawl to escape premiere of Holocaust epic Painted Bird featuring brutal scenes of incest, rape and mutilation,” screamed the Sun. It forgot to mention the bestiality, but others didn’t. The Daily Mail described the film as “a panoply of depravity”. The Guardian reported viewers falling over each other as they rushed for the exits during the first public screening at the Venice film festival. The scene in which a man’s eyes are gouged out with a spoon was a tipping point for many.

Speaking from his study in Prague, director Václav Marhoul recalls those moments with bemusement and exasperation. “In the first screening in Venice, it was 1,500 people and a maximum of 70 walked out,” he says. “That means that 1,430 people stayed. And the next day, from 1,200 people, maybe five left. And then journalists are writing about this massive walkout. I don’t understand it. It’s crazy!”

Marhoul points out another movie that screened at Venice: Todd Philips’ Joker. “The violence in Joker is much more visible, much more brutal, but Joker didn’t get the same reputation.” In his film, says Marhoul, most of the violence is implied rather than depicted. “Joker is a comic-book character but The Painted Bird is truthful. So audiences are scared, but they’re not scared about my movie. Maybe they’re scared about themselves – because I’m showing them something in their own minds, in their own hearts, they would like to hide from. Maybe this is the problem.”

‘What’s going on in my movie is going on around the world’ ... Václav Marhoul. Photograph: Piroschka van de Wouw/Reuters

One source of The Painted Bird’s power is the juxtaposition of unrelenting atrocity and childhood innocence. Adapted from a novel by Polish writer Jerzy Kosiński, the film follows an abandoned boy through an almost medieval eastern European landscape of death, cruelty, superstition, deprivation and madness. Civilisation is barely clinging on as the Nazis tighten their grip. Any fleeting trace of humanity – a small act of kindness, a snatch of song – is a welcome relief. Yet, in contrast to these horrors, The Painted Bird is often ravishing to behold, with pristine cinematography, epic vistas and unforgettable imagery. It feels so authentic, which could be one of the reasons for the walkouts.

As well as witnessing the “panoply of depravity”, the film’s nameless hero, played by Petr Kotlár, is often on the receiving end. He is buried up to his neck and pecked at by crows, cast down a river, forced to drink alcohol, thrown into an open cesspit, and sexually abused (off screen) by a villager who takes him in. This villager is played by Julian Sands – one of a smattering of familiar faces in the film, including Stellan Skarsgård, Harvey Keitel, Udo Kier and Barry Pepper.

Kotlar, who is not a trained actor and was just nine when filming began, puts in such a powerful performance you wonder how Marhoul drew it out of him. “He is from a very good family and he has loving parents and grandparents, which is very important, so his life is great and he is very positive.” His short attention span could make staying focused a challenge, but it was also an asset: when it comes to trauma, says Marhoul, children have certain advantages. “The first is that they have very shallow memories. As adults, we have a lot of deep memories – when we married, when we went to school, when everything was better. The second advantage is that children don’t plan or imagine the future. They are simply living hour by hour, day by day. It’s very helpful for them.”

It was hard for Petr. After, he told me he doesn't want to be an actor

Kotlar did have his grandmother on set, Marhoul stresses, plus a full-time assistant. Also, he was never witnessing the horrors directly – his reactions were filmed separately. Marhoul, a father of four, had a few tricks to elicit the desired facial expressions. “He has a dog and he loves him very much. So I said to him before one shot, ‘Petr, try to imagine that you are out walking your dog and you meet a friend. You forgot the dog is with you. He gets lost. Where is he? Maybe somebody stole him. Maybe he is starving.’ And in that moment the tears came to his eyes. With children, though, always you must say: it’s a game, it’s not real. It’s very important to say it again and again. But it was hard for him. After, he told me he doesn’t want to be an actor.”

Fleeting trace of humanity ... Harvy Keitel in The Painted Bird. Photograph: Dobrovsky/Jan Dobrovský

Getting The Painted Bird to the screen has taken Marhoul over a decade. A producer and actor as well as a director, he first read Kosiński’s book about 15 years ago while working on his 2008 feature Tobruk, following Czech soldiers in north Africa. “This book touched me so much I never forgot it,” he says. “When I finished Tobruk, it came back to me like a boomerang and knocked me in the head. I said, ‘OK, you must try try to obtain the rights.’” That took two years and getting funding took even longer. The shoot then lasted 18 months, across various locations in Ukraine, Poland, Slovakia and the Czech Republic. Kotlár ages visibly through the story.

As for attracting international stars, that began with a bit of luck. Marhoul happened to have met Skarsgård decades ago, before he was famous. “We spent two wonderful days together. I showed him the Prague no other tourist would ever see. We visited bars and clubs and crazy exhibitions. Finally we fought five drunkards on Saturday evening – and we won. So he left full of experiences.” When he texted Skarsgård out of the blue, the Swede called back immediately. With Skarsgård on board, the next actor was easier to get. “My biggest advantage was that they all knew the book.”

Kosiński was something of a controversial writer. When The Painted Bird was first published in 1965, it was assumed to be autobiographical, but critics later disputed this, claiming it was based on the experiences of others, plagiarised, or just pure fiction. But by that time, Kosiński had found success. He went on to write Being There, the source for the celebrated Peter Sellers film. He was friends with such stars as Warren Beatty, Roman Polanski and George Harrison. Beatty, who cast Kosiński in his 1981 movie Reds, allegedly tried to adapt The Painted Bird, although Kosiński said only two directors were capable of the task: Luis Buñuel and Federico Fellini.

Marhoul was less concerned with the truth of all that, he says, than with the truthfulness of the story. “Yes, it’s fiction. So what? Every book in the world is fiction, from Ernest Hemingway to Victor Hugo. But the fiction should be real. And what’s going on in my movie, and what’s going on in the book, is going on around the world at this moment. This very second children are being killed, murdered, abused, burned – in Mali, Syria, Afghanistan, everywhere.”

‘It’s easy to manipulate people with fear’ ... Barry Pepper in The Painted Bird. Photograph: Jan Dobrovský

Marhoul has seen these things first hand. As a reservist in the Czech army, he conducted two tours of Afghanistan. He also worked with Unicef for several years and visited refugee camps in such countries as Rwanda. “I’ve talked to children who have survived war, criminal gangs, rape. For me, it’s a real world.”

There is no disputing the scale of the atrocities inflicted on central and eastern Europe during the second world war. During Hitler and Stalin’s regimes, an estimated 14 million civilians lost their lives in the region, most outside concentration camps. Compared with the reality, Marhoul says, the film is actually toned down.

Citing the resurgence of the far right in Hungary and Poland, the director fears history may be repeating itself. “It’s easy to manipulate people with their fears,” he says. “This is one of the principles of The Painted Bird. Always, you have a problem if you are different.” Today, he says, this could mean immigrants escaping war zones and seeking refuge in Europe, only to be met with hostility. “We are scared. And if we are frightened, we are going to be aggressive. That’s human nature. If we do not understand something, better to attack than have a dialogue.

“This is why I support the European Union. It doesn’t matter if the EU is bureaucratic, it’s about peace. In the past 100 years, Europe has had so many wars, so many people killed, so many villages burned. Europe is a crazy continent. Nazism was a European idea. Communism was a European idea. I am so happy we are not at war – but remember what happened only 30 years ago in Yugoslavia? Evil is just sleeping, I always say, and it’s very easy to wake it up.”

• The Painted Bird is released in the UK on 27 March.