Captain Macheath

Captain Macheath is a fictional character who appears both in John Gay's The Beggar's Opera (1728), its sequel Polly (1777), and 200 years later in Bertolt Brecht's The Threepenny Opera (1928). Even though written "Macheath", the name is pronounced as if it were "MacHeath".

Origins
Macheath made his first appearance in John Gay's The Beggar's Opera as a chivalrous highwayman. He then appeared as a pirate in Gay's sequel.

He was probably inspired in part by Jack Sheppard who, like Macheath, escaped from prison and enjoyed the affections of a prostitute, and despised violence. His nemesis is Peachum who, in John Gay's original work, keeps an account book of unproductive thieves, something that Macheath does for himself in Brecht's work. Both characters can be understood as satires of Robert Walpole and Jonathan Wild.

In popular culture
Captain Macheath is the chief protagonist of the 1841 Victorian penny dreadful Captain Macheath by Pierce Egan the Younger.

In Charles Dickens' novel, Little Dorrit, he is quoted by Bar, a lawyer attending a dinner party held by Mr. Merdle: "a high and solemn occasion, when, as Captain Macheath says, 'the judges are met: a terrible show!' We lawyers are sufficiently liberal, you see, to quote the Captain, though the Captain is severe upon us. Nevertheless, I think I could put in evidence an admission of the Captain's,' said Bar, with a little jocose roll of his head; for, in his legal current of speech, he always assumed the air of rallying himself with the best grace in the world; 'an admission of the Captain's that Law, in the gross, is at least intended to be impartial. For what says the Captain, if I quote him correctly—and if not,' with a light-comedy touch of his double eye-glass on his companion's shoulder, 'my learned friend will set me right:

'Since laws were made for every degree, To curb vice in others as well as in me, I wonder we ha'n't better company Upon Tyburn Tree!'"

In The Threepenny Opera
In Bertolt Brecht's The Threepenny Opera, he is referred to as "Mack the Knife", and is the subject of the song of the same name. While his character plays roughly the same role as in the work it is derived from, Macheath is a much less romantic character here, described as a cutthroat, rapist and seducer of underage girls.