Border is a film so packed with strange surprises that it’s best to see it without knowing anything about it, and almost impossible to discuss in a spoiler-free way. So if that’s the experience you crave, read no further. As its title suggests, Border blurs boundaries. The story begins at a literal border – a Swedish ferry terminal – and proceeds to dismantle more abstract ones: between human and animal, male and female, civilised and primal, right and wrong, possibly sublime and ridiculous. In terms of genre, too, it straddles Nordic noir, outsider romance and folk fantasy. And it features what could well be the weirdest sex scene in the history of cinema.

Our heroine is Tina, a customs officer who immediately seems odd. Her features are almost Neanderthal, with a heavy brow and protruding teeth. Played by Swedish actor Eva Melander (under a layer of facial prosthetics), Tina is a lonely misfit, more at home in the natural world than the human one. She has the ability to sniff out contraband at the border: smuggled alcohol, or, in one pivotal instance, a memory card containing child pornography. “I can just sense these things,” she tells her boss. Things take a turn when an equally Neanderthal-looking stranger named Vore (Finnish actor Eero Milonoff) passes through the border one day. He carries live maggots in his luggage, and he sends Tina’s smell test haywire.

“I’m deformed,” Tina later tells Vore, when they are alone together in the woods. “Shut up,” he tells her. “You’re perfect.”

Crossing the line … Border. Photograph: Meta Spark/Kärnfilm

They begin kissing. It becomes more like an animalistic mating ritual, with grunting and biting. When they take their trousers down, Tina is astounded to see a strange, slender penis grow from her own crotch. She is actually a “male”; Vore has a vagina. The rest comes naturally. Their lovemaking is wild, but also tender and emotional. Having lived her life believing she had a “chromosome deformity”, Tina discovers from Vore who she really is. Or rather, what, though it would be a crime to spoil that particular revelation.

“Of course, I’m not a professional penis designer but I do it once in a while,” laughs Border’s director, Ali Abbasi. “A sex scene for me is essentially a stunt scene. That doesn’t necessarily mean it doesn’t have any emotional value, just that it has a machinery, a choreography that has to be in place before you go forward with everything else.”

‘The part you cannot take out of the car is empathy’ … Ali Abbasi. Photograph: Nadim Carlsen

“For me this movie was about, what are the boundaries of a human being?” Abbasi continues. “If you look at a human as a car, or as a machine, what would be the parts you cannot take away? And what would be the parts you could take away and still call it a human being?” Reproductive organs might be included among those essential parts, but Border is less about fluidity of gender than identity. “She’s an outsider. She’s being treated like a freak. She wants to have her identity and respect, and she feels lonely. It’s very simple.”

Such a unique proposition leaves one grasping for comparisons. Border has echoes of Beauty and the Beast (though this is more Beast and the Beast), not to mention Todd Browning’s Freaks and David Lynch’s The Elephant Man. But its closest relative would have to be Swedish vampire tale Let the Right One In (remade in the US as Let Me In). They share the same author: John Ajvide Lindquist, often described as “the Stephen King of Scandinavia”. Abbasi began to explore Lindqvist’s writings while looking for a follow-up to his debut movie, Shelley – a childbirth horror with echoes of Rosemary’s Baby. He felt a certain affinity with Lindqvist, he says. “How he sees mythology and folklore as metaphors for very simple, banal, but nevertheless acute human problems.”

Border was originally a short story. Abbasi and Lindqvist began adapting it together, but it seems Lindqvist was reluctant to make big changes to his original text, so left Abbasi and his co-writer Isabella Eklöf to take the story where they wished. The gender-mixing element is in Lindqvist’s original. The author likes to insert twists into the mythology. In the novel of Let the Right One In, the “girl” vampire, Eli, is actually an androgynous boy who had been castrated 200 years previously. Eli’s 70-year-old servant is a convicted paedophile who lusts after him. Border mines similar territory with a disturbing child-pornography subplot added by Abbasi and Eklöf.

It is perhaps unsurprising that Abbasi felt a particular connection to Border, as an Iranian man living in Scandinavia. Born and raised near Tehran, Abbasi travelled to Sweden to study architecture in 2000, then went to the Danish National Film School, graduating in 2011. But he doesn’t feel like an alien in Europe. “When you come to a homogenous society like Sweden, and you don’t know the language, you’re a complete outsider,” he says. “But then it’s amazing how quickly you can become an insider if you’re in the right context, with the right people.”

Abbasi’s upper-middle-class roots are more of a social marker than his skin colour or identity, he says. “Let’s face it, I have much more in common with you than I have with 80% of the Iranian population. You and I probably have a lot of the same cultural references; maybe we have same taste in furniture.” Abbasi has a four-year-old son named Luis, after the great Spanish film-maker Luis Buñuel.

“I don’t believe that our identity is solid,” he says. “I am not one person; I am three or four different people. So when I’m in Denmark, I have my Danish version of me, and it’s as valid as my Iranian one. It’s not mixed with it; it’s another, parallel compartment.” This form of identity is a contemporary condition, says Abbasi.

I get asked lots of strange questions at border control – then, once you get in, you're treated with loads of respect Ali Abbasi

Travelling on an Iranian passport has its drawbacks, though. Border’s heroine has a nose for guilty travellers but today’s customs officials prefer to err on the side of caution. Last year, Abbasi became one of the few Iranian citizens to gain an exemption to the “Trump travel ban”, to attend the Telluride film festival in Colorado. “It was a super-complicated process,” he says, even involving letters from US senators, “more like a political campaign.” He is struck by contrasts in how he has been treated: “I can get asked all sorts of strange questions at border control, and then 10 minutes later, people come and pick me up and greet me as if I’m an important person. Before you get in, you’re being treated like shit; once you get in, you’re being treated with loads of respect. Like, which one is it?”

Abbasi acknowledges his public status affords him a degree of control over his identity that most immigrants and refugees in Europe lack. While xenophobia is rising in Sweden and Denmark, Abbasi is becoming something of a celebrity. Border won the Un Certain Regard award at Cannes last year, and took several prizes at Sweden’s prestigious Guldbagge awards – including best film. It was also nominated for best makeup and hairstyling at the Oscars, and deservedly. Despite Melander’s heavy prosthetics (which took four hours to apply daily), her range of twitches, snorts and sniffs is amply expressive. She is better with the makeup than most actors are without it, jokes Abbasi.

In Border, Tina also faces choices over her identity. Like Abbasi, she has an element of control, but, unlike him, she ultimately has to pick a side. How “human” does she want to be? And what is humanity, anyway? Where does it reside? Border suggests it is more than skin- or even genitals-deep. “For me, the most important thing, the part you cannot take out of the car, is empathy,” says Abbasi. “She has this empathy towards humanity, and that’s really the fundamental difference. That’s what makes her more a human being than anything else.”

In Border, humanity is not only a physiological category; it is a moral one, too. Despite its apparently bizarre boundary transgressions, the film argues that sometimes, you really do have to draw the line.

• Border is released on 8 March.