It is one of the most memorable scenes in all theatre: the unrepentant libertine dragged to hell by the marble statue he has, for a laugh, invited over for supper. Don Juan, superman of sex, shaking his fist at the heavens, has been brought to life a thousand times in plays, films, poems, stories and operas – of which Mozart’s is the greatest and most impervious to time and changing fashions.

The composer lived in a questioning age – the Enlightenment of the 18th century had for most educated people really abolished the idea of hell – but the terrifying music he wrote for his climactic scene leaves no doubt we are supposed to take it seriously. Yet the questions remain. What is this ‘hell’, and why exactly is Juan/Giovanni going there? Hasn’t he simply been carrying on in the same way as any lusty nobleman of his time? Surely any decent barrister could get him off that murder rap: it looks uncommonly like self-defence. And come on, just being an unreliable boyfriend can’t be enough to earn damnation. No, there must be more to it.

There is a revealing scene towards the end of the opera. Giovanni is having supper; Elvira (who considers herself his wife), in her usual state of passionate hysterics, rushes in to beg him for the last time to change his life. He rebuffs her yet again, before furiously bawling out his creed: ‘Long live women! Long live good wine! The glory and nourishment of humanity!’

What we have here is a pretty full-on parody of the Last Supper: in place of Christ’s symbolic bread and wine, a bacchanal of female flesh and alcohol. Giovanni’s business is hijacking Christian paradigms and turning them upside down. On top of his blasphemous love-feast, he perverts Christ’s message of love for all mankind into lust towards all women; when offered absolution, he defiantly yells out his refusal to repent. As with Christ’s Ascension, Giovanni vanishes without trace from the earth. Alive, he defies the divinely-ordained nature of things, gleefully courting disaster. He can even bring the dead back to life – the Commendatore’s statue is just a lump of masonry until the sheer power of Giovanni’s scorn does its Frankenstein trick. And even if he’s dragged to hell today, tomorrow he’ll be resurrected on opera stages around the world. No wonder he was a hero to the Romantics, half in love with the satanic.

Mozart and his librettist Lorenzo da Ponte were interested less in Giovanni’s promiscuous carry-on than in this determined blasphemy, this intoxicated moral nihilism. And Don Juan’s origins are certainly religious: he first appears in a 1630 play by the Spanish monk Tirso de Molina, written to illustrate the kinds of sexual behaviour the Catholic church had suddenly decided were a downer for their PR. But the story was too much fun to remain a dry parable, and by Mozart’s time it had become a raucous puppet show – a sort of Punch and Judy knockabout – for the popular theatre.

If Mozart and da Ponte wanted to reintroduce the religious angle, one motive may lie in the librettist’s biography. Born Emanuele Conegliano in the ghetto of Ceneda near Venice, the son of a Jewish furrier, the boy converted to Christianity along with his family at the age of 14; he was educated in a seminary and subsequently became a priest. It wasn’t the most blindingly successful strand of his portfolio career: within a few years he had taken a mistress and fathered two children. In 1779 he was tried for ‘public concubinage’ and banished from Venice for 15 years. That was the end of his ecclesiastical road. But da Ponte knew his theology: Giovanni is a very Christian rebel.

And his crimes are basically religious: Giovanni challenges the ethical basis of society by refusing to acknowledge any moral law except his own right to pursue pleasure and power; he plays with the notion that ‘everything is permitted’. Like Mozart’s contemporary, the infamous Marquis de Sade, the Don pursues a philosophy of absolute freedom – and like Sade, discovers that it leads to absolute despair. In the standard model of the time, justice can only be delivered from above: ‘Vengeance is mine, saith the Lord; I will repay’. These days, tending not to believe that, we are more likely to interpret the ending figuratively. Giovanni, destroyed by outraging his own human nature, creates his own hell: modern interpretations often represent this though madness, breakdown, personality collapse, drugs, suicide. Mozart and da Ponte, orthodox-ish Christians writing on the cusp of the Romantic era, would probably suggest that both alternatives might be possible.

By Mozart’s time the Don Juan legend had also developed into a social comedy, complete with warnings to the proletariat not to be gulled (as Zerlina so eagerly is) by the blandishments of aristocrats; though everyone in the opera knows exactly what to expect from Giovanni, with the exception of poor young fogey Ottavio, who simply cannot believe that a cavaliere is capable of such bounderish behaviour.

As Mozart and da Ponte had already demonstrated in Le nozze di Figaro, social comedy could also be a useful vehicle for social criticism. Comic opera in the 1780s was becoming a more serious business, as the popularity of the Don Juan story shows: Mozart’s was actually the eighth operatic setting of the story in a decade. The only other one you might hear was composed by Giuseppe Gazzaniga earlier in 1787, and provided useful source material for da Ponte when he and Mozart were commissioned for a quick follow-up to Figaro, which was a huge hit in Prague the same year.

Da Ponte raided many other sources in his hurried composition of the libretto, including Molière’s Don Juan (which introduces the figure of Elvira, and fills us in on the fact that she has previously been resident in a convent) and Goldoni’s Don Giovanni Tenorio. But much of the plot – largely a standard comedy of disguises inserted between the Commendatore’s death and his stony reappearance – is his own invention. Much discussion has centred on the dramatic nature of the result. Da Ponte called it ‘dramma giocoso’, which seems to imply a greater seriousness of purpose than ‘opera buffa’, which is what Mozart called it; in fact da Ponte later claimed that it was Mozart who had wanted to write a serious opera, and had to be persuaded to add the comedy. Given that da Ponte was one of the world’s great self-dramatists and remodellers of history, we will never know for sure.

But it doesn’t really matter. He wrote a terrific libretto and Mozart worked wonders with it, musically (obviously) but also certainly dramatically: anyone who has ever studied da Ponte’s far inferior words for other composers will realise that Mozart must have had a huge hand in shaping it. And although the psychological reasons why the subject evoked music of such power from him are unguessable, it is worth noting that – like Hamlet, which features a notable supernatural father figure – the piece was written shortly after the death of the author’s father. We do not have to entirely buy Peter Shaffer’s theory (in Amadeus) that the sheer musical terror of the Commendatore’s reappearance is due to some kind of unconscious Oedipal guilt at the death of Mozart’s father – but neither need we wholly discount it.

The music of Don Giovanni is so miraculous, mysterious, full of subtleties, it is silly to try to summarise it. But it is clearly the work of a driven man, and shares the furious energy of its hero: more even than any other Mozart opera, we feel that every note means something vital to the work. From the thunderous D minor opening of the overture, the striding syncopations that foreshadow the statue’s approach at the other end of the opera, the eerie scales that blow in like a wind from another world, it is clear that this is not your average comedy. Then, suddenly, we are in the buffoon world of Leporello, cold and wet, waiting for Giovanni to finish his business with Donna Anna – then again instantly thrown into high drama, violent struggle and confrontation, sudden death and a stunned stasis. It is the most fearsomely unstoppable introduction to any opera in history.

That is what Giovanni is, too, a whirlwind who concentrates his vast energy whenever a woman hoves into view and becomes the smoothest-tongued of seducers. Much of his work is actually done in conversational recitative; his only true aria is a burst of furious energy where he plots his night-time entertainment, a crazy rout whose entrance password is ‘Viva la libertà!’, where anything goes and where Giovanni will assuredly add a dozen names to his list of 2,065 conquests. Of all the characters in the opera, his is the slipperiest, the least graspable through his own music – as he himself says, ‘chi son io tu non saprai!’ (‘you will never know who I am!’) – but that is because all the music of the opera is his character: that impetus, that demonic energy, from the first chord. And since everything and everyone else in the opera is merely a reaction to him, you could say he actually conjures all the other characters into being. Thus the moral fulcrums of the opera – the time-stands-still trio of Anna, Elvira and Ottavio as they invoke heaven’s aid before the ball, Elvira’s accompanied recitative ‘In quali eccessi’, the apocalyptic eruption of brimstone on stage – are all Giovanni’s creations. When he’s gone, a little fugue – in which, by definition, everyone is reduced to the same musical line, the same characterlessness – peters out into musical inconsequence.

Mozart also demonstrates Giovanni’s social anarchism in the neatest possible way: having three dances in different metres playing simultaneously (one for toffs, one for proles, one for the bourgeois), he engineers a musical dissolution that precisely mirrors Giovanni’s disastrous effect on the world. This is the real, scary meaning of the ‘freedom’ – la libertà! – he makes everyone toast; and indeed, within two years that word would be being paraded around revolutionary Paris alongside severed heads on pikes. How did Mozart know?

It’s an interesting fact that, while we are supposed to deplore Giovanni’s behaviour, the opera can hardly work unless we have a sneaking admiration for him too. Sure, it’s hardly unalloyed: he fails even more than the usual run of operatic heroes to abide by the norms of civilised behaviour; he leaves a trail of destruction in his wake, notably ruining the life of Elvira, the only character about whom we can really care and towards whom he behaves with deplorable sadism. But in spite of everything, nobody is happy when Giovanni is consigned to Hell. The other characters are pathetically diminished, rounding the thing off with their lower-middle-class cliché – see how evil-doers come to grief! – before wondering sadly what to do with themselves now the fun’s over.

Nothing in his life becomes Giovanni so much as his leaving it, attaining a madly inspiring magnificence. Confronted by the preposterous statue which claims to represent divine retribution, Giovanni refuses to betray himself or his convictions. In Tirso’s play the hero begs for mercy before meeting his fate. Not here: our man savours victory in the teeth of defeat (as Tirso tells us, the result is exactly the same) even as he descends to a hell whose fires, extinguished by the rationalism of the 18th century, he has stoked back to life through the sheer affront of refusing to believe in them. And this is what made him a Romantic hero: the fact that he is ‘prepared to plead his values of individual freedom at the bar of heaven itself’, as Nicholas Till wrote.

It may not make Giovanni a great guy, but it undoubtedly makes a great opera. Opera loves transgression: doing the forbidden thing is how its personnel explore on our behalf what it means to be human. Giovanni is the boss of this company, challenging heaven and hell as no one else ever did. As Denis de Rougemont wrote: ‘If the laws of morality did not exist, he would invent them in order to violate them.’ Mozart’s opera and hero capture a vital ambiguity at the heart of our nature. Giovanni is the embodiment of a central human dilemma, a revolutionary who refuses the ways of heaven and earth, who demonstrates where the quest for individual liberty collides with duty towards fellow humans – and towards God.