The Iranian film-maker Asghar Farhadi has come to Cannes with an absorbing, fascinating if slightly contrived movie, a loss-of-love-triangle starring Bérénice Bejo, Ali Mosaffa and Tahar Rahim. A Frenchwoman, Marie (Bejo), is attempting to resolve difficulties with her Iranian husband, Ahmad (Mosaffa), from whom she has been long separated, and to make a fresh start with a new partner, Samir (Rahim). The film revisits some themes of Asghar's breakthrough film A Separation, about the mortality of love, along with ideas about intimacy and domesticity in a world where the stepfamily is the norm. Here it is further supercharged with a grand tragic theme — the past and its pitiless grip on us. Farhadi shows the desperation and anger involved in trying to defy the past, to annul incorrect life-choices.

It is an intricate and often brilliant drama, with restrained and intelligent performances; there is an elegantly patterned mosaic of detail, unexpected plot turns, suspenseful twists and revelations. The narrative structure itself is perhaps a little over-determined; there is some melodrama in the tragedy, and the continued absence from the screen of one important character perhaps makes the final scene a little easy to guess. It is often rather like a stage-play, but interestingly and bracingly so. The continuing force and intelligence of Farhadi's film-making is compelling.

Marie has asked Ahmad to return to Paris from Teheran, to be present for the long-delayed and much-disputed divorce proceedings; he is not legally required to be there, but Marie wants closure, to bid a civilised, grown-up farewell to their failed marriage, and also for him to say a considerate goodbye to her children from the relationship that preceded theirs who were always fond of him: little Léa (Jeanne Jestin) and stroppy teen Lucie (Pauline Burlet).

But to Ahmad's dismay, Marie has not booked him a hotel, but for complex and unexamined motives expects him to stay in her small, chaotic house, putting him right in the middle of her current ménage; her new, younger partner Samir (Rahim), who owns a dry-cleaning store, has moved in with his little boy Fouad (Elyes Aguis). To Samir's chagrin, Ahmad and Marie still appear to have the relationship of a married couple — albeit an unhappy one — and all three children respond naturally to Ahmad as a father figure, making the tangled, complicated and painful situation even more intense. Even more burdensome is a further task Marie expects of Ahmad: to talk to Lucie and ask her why she is so angry. Her answers disclose agonising and even terrifying truths about what has led to their current situation.

Farhadi shows that anatomising relationships is vivisection: painful and possibly even distorting. Should Marie have finalised her divorce in Ahmad's absence? Should she have simply cut the bonds with the past, and dealt with Lucie's unhappiness herself? And if Lucie's unhappiness stems from discontent with her new partner, wouldn't it have been better to keep her old partner out of it? Farhadi shows us that "yes" might well be the rational answer to all three questions, but also that they are irrelevant: Marie was compelled to bring Ahmad back, to confront him in some destructive way — and being compelled by the same forces which are hitching her up with Samir. What is compelling about the drama is the importance attached to the act of apologising. The children are forced to say sorry for some misdemeanour, or they will not get their presents; Samir apologises for his behaviour to Marie — who angrily says that this "sorry" does not get him off the hook. Perhaps the civilised habit of apology and atonement, so far from divorcing us from the misdeeds of the past, encourages their repetition.

I wonder if Farhadi hasn't overloaded his film with an almost exotic abundance of detail and plot surprises, taking it to the limit of plausibility. But what a grippingly made picture it is, with real intellectual sinew, from the bravura opening scene – Marie picks Ahmad up at the airport, driving an unfamiliar car and backing out of her parking spot she almost has some kind of unexplained prang: a disaster which Farhadi cleverly follows with his opening title, The Past, with a windscreen-wiper motif. Backing out is dangerous; reversing is dangerous; the past is dangerous.