Après le succès sensationnel de "HMS Pinafore", de nombreuses compagnies de spectacle américaines avaient présenté des versions non autorisées de cet opéra. Gilbert, Sullivan et Carte ont décidé d'éviter que cela ne se reproduiseavec leur nouvelle création, "Les Pirates de Penzance", en en présentant les versions officielles simultanément en Angleterre et en Amérique. L'opéra fut créé le 31 décembre 1879 au Fifth Avenue Theatre à New York sous la direction de Sullivan, mais une seule représentation avait été donnée la veille au Royal Bijou Theatre, Paignton, Angleterre, pour garantir le droit d'auteur britannique. Enfin, l'opéra a ouvert ses portes le 3 avril 1880, à l'Opéra Comique de Londres, où il s'est joué pour 363 représentations, ayant connu un succès parallèle pendant plus de trois mois à New York.
Act I
On the coast of Cornwall, at the time of Queen Victoria's reign, Frederic, a young man with a strong sense of duty, celebrates the completion of his twenty-first year and the apparent end of his apprenticeship to a gentlemanly band of pirates ("Pour, oh pour the pirate sherry"). The pirates' maid of all work, Ruth, appears and reveals that, as Frederic's nursemaid long ago, she had made a mistake "through being hard of hearing": she had misheard Frederic's father's instructions and apprenticed him to a pirate, instead of to a ship's pilot ("When Frederic was a little lad").
Frederic has never seen any woman other than Ruth, and he believes her to be beautiful. The pirates know better and suggest that Frederic take Ruth with him when he returns to civilisation. Frederic announces that, although it pains him to do so, such is his sense of duty that, once free from his apprenticeship, he will be forced to devote himself to the pirates' extermination. He points out that they are not very successful pirates, since, being orphans themselves, they allow their prey to go free if they too are orphans. Frederic notes that word of this has got about, so captured ships' companies routinely claim to be orphans. Frederic invites the pirates to give up piracy and go with him, so that he need not destroy them, but the Pirate King notes that, compared with respectability, piracy is comparatively honest ("Oh! better far to live and die"). The pirates depart, leaving Frederic and Ruth. Frederic sees a group of beautiful young girls approaching the pirate lair, and realises that Ruth lied to him about her appearance ("Oh false one! You have deceived me!"). Sending Ruth away, Frederic hides before the girls arrive.
The girls burst exuberantly upon the secluded spot ("Climbing over rocky mountain"). Frederic reveals himself ("Stop, ladies, pray!") and appeals to them to help him reform ("Oh! is there not one maiden breast?"). One of them, Mabel, responds to his plea, and chides her sisters for their lack of charity ("Oh sisters deaf to pity's name for shame!"). She sings to him ("Poor wand'ring one"), and Frederic and Mabel quickly fall in love. The other girls contemplate whether to eavesdrop or to leave the new couple alone ("What ought we to do?"), and eventually decide to "talk about the weather," although they steal a glance or two at the affectionate couple ("How beautifully blue the sky").
Frederic warns the girls of the pirates nearby ("Stay, we must not lose our senses"), but before they can flee, the pirates arrive and capture all the girls, intending to marry them ("Here's a first rate opportunity"). Mabel warns the pirates that the girls' father is a Major-General ("Hold, monsters!"), who soon arrives and introduces himself ("I am the very model of a modern Major-General"). He appeals to the pirates not to take his daughters, leaving him to face his old age alone. Having heard of the famous Pirates of Penzance, he pretends that he is an orphan to elicit their sympathy ("Oh, men of dark and dismal fate"). The soft-hearted pirates are sympathetic and release the girls ("Hail, Poetry!"), making Major-General Stanley and his daughters honorary members of their band ("Pray observe the magnanimity").
Act II
The Major-General sits in a ruined chapel on his estate, surrounded by his daughters. His conscience is tortured by the lie that he told the pirates, and the girls attempt to console him ("Oh dry the glist'ning tear"). The Sergeant of Police and his corps arrive to announce their readiness to go forth to arrest the pirates ("When the foeman bares his steel"). The girls loudly express their admiration of the police for facing likely slaughter at the hands of fierce and merciless foes. The police are unnerved by this, and remain around (to the Major-General's frustration) but finally leave.
Left alone, Frederic, who is to lead the group, pauses to reflect on his opportunity to atone for a life of piracy ("Now for the pirate's lair"), at which point he encounters Ruth and the Pirate King. It has occurred to them that his apprenticeship was worded so as to bind him to them until his twenty-first birthday – and, because that birthday happens to be on 29 February (in a leap year), it means that technically only five birthdays have passed ("When you had left our pirate fold"), and he will not reach his twenty-first birthday until he is in his eighties. Frederic is convinced by this logic that he must rejoin the pirates, and thus he sees it as his duty to inform the Pirate King of the Major-General's deception. The outraged outlaw declares that their "revenge will be swift and terrible" ("Away, away, my heart's on fire").
Frederic meets Mabel ("All is prepared"), and she pleads with him to stay ("Stay Frederic, stay"), but he explains that he must fulfil his duty to the pirates until his 21st birthday in 1940. He promises to return then and claim her. They agree to be faithful to each other until then, though to Mabel "It seems so long" ("Oh here is love and here is truth"), and Frederic departs. Mabel steels herself ("No, I'll be brave") and tells the police that they must go alone to face the pirates. They muse that an outlaw might be just like any other man, and it is a shame to deprive him of "that liberty which is so dear to all" ("When a felon's not engaged in his employment"). The police hide on hearing the approach of the pirates ("A rollicking band of pirates we"), who have stolen onto the grounds, meaning to avenge themselves for the Major-General's lie ("With cat-like tread").
The police and the pirates prepare for the fight ("Hush, hush! not a word"). Just then, the Major-General appears, sleepless with guilt, and the pirates also hide, while General Stanley listens to the soothing sighing of the breeze ("Sighing softly to the river"). The girls come looking for him ("Now what is this and what is that"). The pirates leap to the attack, and the police rush to the defence; but the police are easily defeated, and the Pirate King urges the captured Major-General to prepare for death. The Sergeant plays his trump card, demanding that the pirates yield "in Queen Victoria's name"; the pirates, overcome with loyalty to their Queen, do so. Ruth appears and reveals that the orphan pirates are in fact "all noblemen who have gone wrong". The Major-General is impressed by this and all is forgiven. Frederic and Mabel are reunited, and the Major-General is happy to marry his daughters to the noble pirates after all.