The enfant-terrible director Lars von Trier has shocked audiences at the Cannes Film Festival with this grisly serial-killer comedy, writes Nicholas Barber.

Dozens of people walked out in disgust when The House That Jack Built premiered at Cannes, and while I can certainly understand their reasons, I was happy to stay all the way until the jaw-dropping ending. The film is a dark and grisly serial-killer comedy – but, more relevantly, it’s a dark and grisly serial-killer comedy written and directed by Lars von Trier. That means it’s overlong, overblown, sometimes boring, sometimes shocking, but undoubtedly a bold and stimulating film which no one but Denmark’s notorious provocateur-auteur could have made.

It’s structured as a dialogue between Jack (Matt Dillon), a homicidal maniac, and an unseen interviewer named Verge (Bruno Ganz) – there’s a pun in there that I won’t give away. Jack is telling Verge about five “incidents” he’s picked from his murdering career, which seems to run through the 1970s in an unspecified US town. (Mind you, Jack has childhood memories of farmhands using scythes in meadows, so you can’t be too sure of which decade, or even which country, it’s set in).

He is having a sly jab at Silence of the Lambs, Se7en, and all those other films which present serial killers as cultured masterminds

In the first, funniest segment, he is driving along a forest road in his red van when he is flagged down by an entitled, snobbish woman (airily played by Uma Thurman) whose car has a flat tyre. As reluctant as Jack is to drive her to a garage, she won’t take no for an answer, and once she’s sitting next to him, she insists on joking with her new acquaintance that he might be a serial killer.

After this ironic encounter gives him a taste for butchery, we see him strangling, stabbing and shooting innocent victims and then arranging their corpses, like shop-window mannequins, in a cold storage unit alongside shelves of frozen pizzas. On one occasion, he gets into a house by pretending, badly, to be a policeman; on another he brings new meaning to the phrase ‘family hunting trip’; on another he insults a young woman he calls “Simple” (Riley Keough, bringing some surprisingly touching humanity to an otherwise callous film). He claims to have chosen these anecdotes “randomly”, but Verge disagrees: Jack, he argues, is always trying to make himself seem clever and women seem stupid.

As well as commenting on his own career and reputation, von Trier is having a sly jab at Silence of the Lambs, Se7en, and all those other films which present serial killers as cultured masterminds. Jack sees himself in that mould. He drones on about why his crimes count as art, and he even nicknames himself Mr Sophistication. But von Trier makes it clear that he is actually a doofus. In wide-rimmed glasses, and with his slab of a face cracked by gormless puzzlement, Dillon is excellent in the role of the uncomfortable Jack: a neurotic blunderer who manages to kill over 60 people only because he is so absurdly lucky and the local police are so absurdly inept – and, perhaps, because the world is a fundamentally uncaring place.

I suspect that more people will be put off by the lengthy seminars than they will by the sadism and gore

Nonetheless, Jack tries to assert his intellectual credentials by delivering digressive lectures on German dive-bomber design, the role of putrefaction in the production of dessert wine, and the purposes of atrocity in art – a theme illustrated by clips from von Trier’s own films. Verge is bored and annoyed by these studenty musings, and many viewers will be, too. There are several graphic scenes of misogynistic torture and mutilation in The House That Jack Built – although I’ve seen a lot worse in supposedly mainstream US thrillers – but I suspect that more people will be put off by the lengthy seminars than they will by the sadism and gore.

I glanced at my watch once or twice myself, but most of the time I was challenged, appalled and amused by von Trier’s mischievous deconstruction of the serial-killer genre, as well as being impressed by his uncompromising bravado and technical brilliance: the film finishes with some magnificent supernatural imagery which would be the highpoint of any Hollywood fantasy blockbuster. You may be tempted to walk out of The House That Jack Built before then, but you’ll definitely be talking about it afterwards.

★★★★☆ 

If you would like to comment on this story or anything else you have seen on BBC Culture, head over to our Facebook page or message us on Twitter.

And if you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories f–rom BBC Future, Culture, Capital and Travel, delivered to your inbox every Friday.