Kenneth MacMillan's Mayerling – like many of this brilliant choreographer's greatest works – depicts a mind driven beyond despair. For this 1978 Royal Ballet commission MacMillan and his dramaturg Gillian Freeman turned to a historical event: the Mayerling Incident, a tragedy and scandal of the late 19th-century Austro-Hungarian imperial family that shocked a continent.

The events one night in Mayerling, a Viennese hunting lodge belonging to the Empire's Crown Prince Rudolf, have been variously romanticized, scrutinized and mythologized; but in its simplest form the story is of a group of people at once instruments and victims of the rot eating at the heart of imperial Europe.

Early on 30 January 1889 the bodies of the 30-year-old Crown Prince Rudolf and his 17-year-old mistress Baroness Mary Vetsera were discovered in his bed at Mayerling, with his gun beside them. Mary's uncles were urgently summoned; her corpse was dressed and her hair arranged over the bullet hole; propped upright by a broomstick, her body was escorted by carriage to a nearby graveyard and secretly interred. Rudolf's death was announced, first declared as a heart attack, then as an accident. At last his father, the Emperor Franz Joseph, officially acknowledged his son's suicide but not Mary's death, then opened an inquest only to close it abruptly and charge his Prime Minister with burying the investigation. For the rest of his life Franz Joseph maintained a rigorous silence, breaking it only to declare, 'The truth is far worse than all versions'.

That truth can never be fully known, but with the gradual release of letters and documents, and even some self-exonerating memoirs, a tapestry of facts begins to emerge. Rudolf's series of suicide notes suggest that some of the wildest conspiracy theories are wide of the mark. The notes themselves specify no further reason for the murder and suicide than that Rudolf's honour demanded it. Various rationales have been proposed: that Rudolf was heavily in debt, that he feared pressure from the Hungarian nationalists with whom he had become involved, that he feared the venereal disease that afflicted him, or the madness rife in his mother's family.

All no doubt played a part. But for much of his life Rudolf seems to have had an obsession with death, writing that 'the opportunity of watching someone die and hearing him breathe his last… is always a remarkable spectacle for me'. He seems to have needed a companion in death, and had begun his search months before the Incident. In December 1888 he asked his demi-monde mistress Mitzi Kaspar to commit suicide with him; she alerted the police chief, who apparently simply filed the report away. In the end it would be Rudolf's cousin and old flame Baroness Marie Larisch who played the gruesome role of procuress.

Marie fostered a relationship between Rudolf and the impressionable Mary Vetsera, who had been entrusted to Marie's care by her mother (herself allegedly another former mistress of Rudolf's). In her memoirs Marie claims she was trapped between the aggressive demands of the volatile Crown Prince and her duty to Mary's mother, who relied upon her daughter's success at court to boost the family's ailing finances. She further hints at a possible coup-d'état headed by Rudolf and a sinister conspiracy to suppress it. Whatever her reasons, letters from the time track a chilling story: Marie Larisch encouraging Rudolf in his suicide-wish, calming Mary's fears, even delivering the young woman to Mayerling on the night of her death.

Ultimately this was a time rife with corruption, endemic hypocrisy and grotesque decadence, from which no one player in the Mayerling drama comes through unsullied. It's difficult not to conclude that the whole era was at fault.

Nearly 90 years after the original incident, MacMillan and Freeman scoured letters, diaries, official reports both ostentatiously proclaimed and suppressed. What emerges is a series of portraits of uniquely compelling intensity. The result is MacMillan's masterpiece.

The production is staged with generous philanthropic support from Julia and Hans Rausing, the Paul Ferguson Memorial Fund, Richard and Delia Baker, John and Susan Burns, Marina Hobson OBE, The Gerald Ronson Family Foundation and Celia Blakey.