The Beggar's Opera was the very first 'English' Opera, written by John Gay, and first performed in London during 1728. It was a great success, and was performed more than any other play in the 18th century. Totally unlike the Italian operas of its time, the Beggar's Opera used both dialogue and music to move the plot forward. The music was 'borrowed' from popular ballads of the time, or from other contemporary composers (including Handel), and Gay fitted his lyrics to these tunes (originally over sixty-nine of them) to form the backbone of the play. Unlike the popular opera of the time, Gay chose his subject from the lower orders of society - thieves, cut-throats, whores, fences and goalers.
Despite its setting in the criminal world of contemporary London, the Beggar's Opera is a comic satire on both society and politics. Gay's 'hero', Macheath, is a highwayman, and was clearly understood by the audiences of the time to represent the then Prime Minister, Walpole. Walpole had his revenge for this satire by having Gay's next play, Polly, banned from performance.
The Beggar's Opera takes its title from the Beggar who claims to have written the piece for the pleasure of his fellow vagrants. It tells the story of the tangled relationships between Macheath and the daughters of Peachum (a fence) and Lockit (a gaoler at Newgate). Upon discovering the marriage of Macheath and his daughter, Polly, Peachum, determines to have Macheath arrested and hanged. Polly warns him, but Macheath cannot resist the company of whores, who betray him. Lucy (Lockit's daughter) is already pregnant with Macheath's child, and when Macheath is cast into Newgate prison, she naively believes his protestations that there is nothing between himself and Polly, and helps him to escape.
Macheath is recaptured, and sentenced to death. Just as he is about to be hanged, four more wives are discovered, each with a child apiece. This is too much for Macheath, and he prepares himself to be hanged.
At this point, the Beggar is persuaded to change the result from a tragic execution, to a happy ending, more in tune with the expectations of the audience. Macheath is reprieved, and takes Polly as his wife.