Palestinian-Israeli writer-director Maha Haj‘s rather impressive second film won best screenplay in the Un Certain Regard competition at Cannes. It’s a complex and piquant tale of masculinity that’s told with a wryness and deadpan distance unusual for films from that area, which seem to pick up a tinderbox political charge by osmosis.

Waleed (Amer Hlehel) is a Palestinian living in Haifa, Israel with his wife Ola (Anat Hadid) and two children. Crippled with depression, Waleed has quit his job and sits at a blank computer screen, waiting for inspiration to hit and his crime novel to flow. Distracted by loud music from his new neighbour’s apartment he meets the jovial Jalal (Ashraf Farah). Waleed is at first irritated by his neighbour, but becomes intrigued when he discovers Jalal’s sideline as a low-level criminal. To Waleed’s own amazement they becomes unlikely buddies, but something darker clouds the edges of this new friendship.

Waleed and Jalal gradually become a hermetically sealed little duo and the film closes in around them. Hlehel and Farah play this beautifully, with Waleed opening up at the excitement he sees in his new pal’s life, and Jalal enfolding this strange and melancholy man into his slightly chaotic bosom. The motives of both men – who have nothing in common – remain largely mysterious, but the friendship is certainly real.

There are darker issues of serious mental illness at play in Mediterranean Fever, but as with the political tensions – implied through Waleed’s status as a Palestinian in Israel – they emerge as something lurking in the margins. Haj’s film is serious, but its methods are deft and playful, mining humour from the frustrations of Waleed and Jalal’s families as the two close themselves off in a bubble. Haj suggests the closeness of the two men as a kind of insanity in itself, as Ola is never simply dismissed as a stereotypical nagging wife. Instead, she’s someone who loves this schlubby, melancholy little man for better or worse.

It’s a strangely compelling movie for the most part, seemingly puttering away in its own quirky little space, until a sudden switch occurs in the final act. This will either undermine what has come before, or bring a welcome burst of black comedy to the proceedings. Given how gently paced the film had been up to that point, it does play as slightly jarring. The pacing becomes swifter, and less laconic. The satire becomes thicker and more brutal. It’s arguable that a less subtle first two acts would delight the impact of the third, but although the signs are there of the direction the story is going to take, it’s a curiously blunt volte-face for a film, and a director, with otherwise impeccable control.

A second screening of Mediterranean Fever takes on Sat 20 August in Vue Cinema 12 @14:20