An S&M love story might seem like an odd choice for an enjoyable night out at the pictures – but Steven Shainberg’s Secretary is a darkly comic and surprisingly tender minor masterpiece. From the opening title sequence with its quirky music and close-up of typewriter keys, we are drawn into the bizarre office world inhabited by Maggie Gyllenhaal as the troubled masochistic secretary, Lee Holloway, and her equally troubled lawyer boss Edward Grey (James Spader). His office is decorated with heavy, vivid colours, elaborate water features and exotic flowers that he tends to with a syringe. A signboard hangs outside with the words "Secretary wanted" – its lights only extinguished by Lee’s arrival. It’s clear that secretaries come and go on a regular basis.

Before the office romance begins, Shainberg flashes back six months, as Lee readjusts to life after her release from a psychiatric institute. Her father is a violent alcoholic and her mother is overly attentive. They inhabit a bleak world which Lee can only escape from by either floating in water (Shainberg repeatedly films her floating in the swimming pool or sitting in a deep bath – a symbolic return to the womb for this damaged individual) or by cutting herself with a special sewing kit she has just for the purpose. The kit is kept in a mauve case, and various shades of pink and purple surround Lee at all times – bruised colours which mirror her own emotional and physical wounds. Her fantasy life is infinitely more colourful than the grey world in which she lives. Only when she arrives at the lawyer’s office – all wounded vulnerability in her bright purple raincoat and sheltering under her broken umbrella – does she find a world which matches her own colourful imagination.

Her new boss Edward Grey (who deep down is anything but grey) turns out to be the perfect foil for her masochistic tendencies. He is taciturn, weird, and at times downright creepy, but recognising her as a kindred spirit, he quickly becomes aroused by her wilful submissiveness (and her taste for corporal punishment). This propels him into fits of self-doubt, which he can only expunge by exercising frantically. By revealing his deeper self, he has to face up to the danger of his own vulnerability.

Their mutual arousal leads to ever more erotic sado-masochistic role-playing, but Grey makes it clear that he is does not want to sleep with her. He also tells her categorically that she will never cut herself again. Their odd games are sometimes rough (he smacks her bottom for making minor typing errors) and sometimes playful: in one scene, he calls her and tells her what she can eat at the family dinner. It’s domineering, but at the same time oddly sweet and tender – almost romantic.

From here on it’s pretty much a conventional story of will they or won’t they get it together, but this convention in itself seems subversive when you consider the unusual nature of their relationship. Both characters clearly have substantial psychological baggage and engage in what most people would consider dysfunctional behaviour, yet they obviously belong together – and we find ourselves wanting them to be together.

The film raises many questions – perhaps more than it can really answer. On one level there is the straightforward issue of whether sadomasochism is acceptable as the basis for a relationship. Are there limits to what two consensual adults can do to one another? There is also the question of how we deal as adults with the legacy of our upbringing. Lee’s self-mutilation seems to have originated as a reaction to her father’s alcoholism, and his eventual sobriety seems to trigger her emotional maturity as a woman.

Primarily, however, this film is an examination of intimacy. Lee tells Grey that she wants to "know" him – and that includes the sado-masochist tendencies that he himself is disturbed by, but which she finds endearing. Similarly she wants him to see the scars that she bears, both literally and metaphorically, and to love her regardless. Theirs is an extreme version of the fundamental notion that women give so that men will reveal themselves.

Anyone who sees this film will come away with their own interpretation – and probably not all will be favourable – but there is much to enjoy in it anyway. It is beautifully shot, superbly directed, subtly written, and brilliantly acted. Gyllenhaal is excellent as the vulnerable Lee – broken, determined, loving, and sexy all at the same time – and Spader is outstanding as Grey. At first he just seems horrendously creepy – another of the goggle-eyed psychos in which seems to specialise – but as the film progresses, the character’s eccentricites translate into a surprisingly moving depiction of tenderness and vulnerability.