When the cast sheet warns the audience that there will be gunshots in each act, you know you are not at The Nutcracker. Kenneth MacMillan’s 1978 ballet Mayerling is famously about sex, obsession, madness and death – a cocktail that apparently sells enough tickets to ensure its regular revival at the Royal Opera House. It is perhaps less famously also about politics, and the stifling, intrigue-ridden world of the Habsburg court in fin-de-siècle Vienna – the social context in which, in 1889, Rudolf, Crown Prince of Austria-Hungary, shot himself in a hunting lodge after murdering his 17-year-old mistress in an apparent suicide pact. Political drama is not normally the territory of ballet, for the fairly obvious reason that it tends to rely on the kind of detail that is much better conveyed by words than movements, so there is a praiseworthy gumption in MacMillan’s decision to tackle this subject matter, and an even more praiseworthy achievement in The Royal Ballet’s effective realisation of his vision. This psycho-drama is one of 20th-century ballet’s landmark achievements, and The Royal Ballet proved on Friday that it still has the actor-principals with the power to pull it off.

As with most MacMillan story ballets, in Mayerling there is a noticeable difference in choreographic quality between the crowd scenes and the intimate scenes. Here this is perfectly harnessed to the story, in which the court world must of necessity be nearly unbearable to have produced Crown Prince Rudolf, a tortured wreck of a man. In the first act, at Rudolf’s wedding ball, the court appears as a whirl of confusing, overbearing grandeur, dark sets and heavy costumes. It is hard to pick out named characters, harder still to follow what is going on, except that it is all, somehow, rather distasteful. A later scene set in a brothel takes no Moulin Rouge glamourising approach to its cast of whores and aristocrats, while the brief vignette of a hunting party seems so unpleasant that one almost applauds Rudolf for shooting someone just to bring it to an end. MacMillan succeeds admirably in showing a world in which it is hard to live normally or to breathe freely, a world so awful that its creations, the various miserable protagonists, command sympathy even as they repel.

The intimate interactions between characters in this ballet are by far its strongest feature – MacMillan was an acknowledged master of intense pas de deux (and trois). In most of these, Edward Watson is central: he is an utterly mesmerising Prince Rudolf, whose volatile personality and borderline madness are destructively fascinating to at least five women – played to perfection by a Royal Ballet cast of exceptionally strong dancer-actresses. Emma Maguire as Princess Stephanie maintains a carefully judged brittle dignity even as the unhinged Rudolf threatens her with a skull and pistol on their wedding night. Sarah Lamb is the hard-to-comprehend Countess Larisch, Rudolf’s ex-mistress who plays a pivotal role in setting up the tragedy with the teenage Mary Vetsera. The scenes between Lamb and the Vetseras (Mara Galeazzi as Mary, Elizabeth McGorian as her widowed mother) are a study in manipulation, and a welcome reminder that this tragedy is not caused by Rudolf’s madness alone: the people around him have their own demons. Laura Morera danced Mitzi Caspar, a high-class prostitute, with enjoyable flair and self-possession – her self-respecting decision to walk away from Rudolf makes her one of the few characters who is almost likeable.

Zenaida Yanowsky deserves particular praise for her portrayal of Rudolf’s mother Elisabeth, the iconic Empress whose fragile beauty, dark eyes and eventual assassination have made her into an Austrian Princess Diana, beloved of the Viennese tourism industry. The tall, lithe Yanowsky is an extraordinary dramatic ballerina: behind the stiff unhappiness of her Empress we see traces of the passionate girl she was before long years in Vienna left her emotionally wrecked. In her compelling duet with Watson, which deserves to stand as ballet’s equivalet of Gertrude and Hamlet, mother and son are trapped in their own misery, unable ultimately to communicate with or help each other.

Mara Galeazzi as Mary Vetsera gives a remarkable account of teenage obsession, a kind of anti-Juliet, whose intense passion for Rudolf is entirely believable. The last scene, in which Rudolf (high on morphine) and Vetsera dance an increasingly agonised duet with a pistol, is tensely, uncomfortably gripping – Galeazzi finds a wildness which can match Watson’s and which makes it hard for the audience to know which of the two of them is the more to be pitied or feared.

Watching Mayerling puts the audience through the ringer emotionally. It is hard to say that it is an enjoyable experience, but it is certainly worth going, even if just to marvel at the psychological depths that ballet can plumb.