Polly, the only daughter of Mr. Peachum, king of the beggars, marries the notorious thief Macheath. Motivated by his own self-interest, Peachum not only disapproves of the match, but he also sees Macheath as a mortal enemy and threat to his business. He and his wife, Celia, hatch a plan to get Macheath arrested and hanged, but Polly informs them that London’s chief of police, Tiger Brown, attended their wedding as a friend of the groom. The two friends, who served together in the Indian army, enjoy a symbiotic relationship in which Brown informs Macheath of possible arrests, and Macheath lets Brown know when a crime is about to take place.

Trying to catch Macheath, Mrs. Peachum enlists the help of Macheath’s former lover, the prostitute Jenny. She agrees to give up Macheath’s location for ten shillings and tells Mrs. Peachum that even if Macheath is trying to outwit the police, he will not give up his Thursday visit to the brothel. Mr. Peachum blackmails Brown into capturing Macheath by threatening that he will set his brood of beggars loose on the grounds of Buckingham Palace before the queen’s coronation on Friday. Trapped, Brown agrees to arrest his friend.

When Macheath enters the brothel, Jenny reads his palm, suggesting that Macheath will be betrayed by someone whose name begins with the letter J. Soon after, Constable Smith captures him and throws him in jail at the Old Bailey. Polly visits him in jail, but Lucy, Brown’s daughter and another of Macheath’s women, interrupts them. Lucy and Polly begin arguing over who is the rightful wife of Macheath. Lucy reveals that she’s pregnant. After Polly—kicking and screaming—is collected by Mrs. Peachum, Macheath asks Lucy to bring him his hat and cane. Smith soon opens the cage to remove Macheath’s personal effects, but while the door is open, Macheath escapes.

Jenny goes to Peachum’s office and demands her ten shillings. When Mrs. Peachum denies her payment because of Macheath’s escape, Jenny betrays his location once again, revealing that he is with the prostitute Suky Tawdry. Brown bursts in to arrest Peachum for threatening to set his beggars loose at the coronation. Brown orders the constables to arrest the beggars, but Peachum warns Brown that capturing them will disrupt the coronation, create a huge mess for the police, and ruin Brown’s reputation as sheriff. Prompted by Peachum, Jenny reveals Macheath’s location once again, and Brown calls an emergency conference of sergeants. Peachum sends the beggars to the jail, expecting that the police will capture Macheath.

Quickly discovered, Macheath is thrown back in jail and informed that he will be executed on Friday at six in the evening. Macheath attempts to bribe Smith with a thousand pounds, although a consultation with two of his fellow thieves reveals that only the sum of four hundred pounds is available. When Smith goes to fetch Macheath’s last meal, Polly and Brown enter with their apologies and last words and are soon joined by the rest of the characters. Macheath cries for mercy, but when the group reaches the gallows, a mounted messenger appears, bringing news that the queen has demanded the release of Macheath. As the crowd cheers, both Mr. and Mrs. Peachum address the audience, reminding them that happy endings do not happen in reality.