On the coast of Cornwall, at the time of Queen Victoria's reign, Frederic, a young man with a strong sense of duty, celebrates, amidst the pirates, the completion of his twenty-first year and the apparent end of his apprenticeship. 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.
Frederic has never seen any women other than Ruth, and he believes her to be beautiful. However, the pirates know better and suggest that Frederic take Ruth with him when he returns to civilization. Frederic announces that, although it pains him to do so, once free from his apprenticeship, he will be forced to devote himself to their extermination (due to an overwhelming sense of duty). 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 reveals that this is widely-known information, so captured ships' companies routinely claim to be orphans in order to escape. 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. The pirates depart, leaving Frederic and Ruth. Frederic sees a group of beautiful young girls approaching the pirate lair, and realizes that Ruth lied to him about her appearance. Sending Ruth away, Frederic hides before the girls arrive.
The girls soon enter the scene. Frederic reveals himself and appeals to them to help him reform . One of them, Mabel, responds to his plea, and chides her sisters for their lack of charity. Frederic and Mabel quickly fall in love. The other girls contemplate whether to eavesdrop or to leave the new couple alone, and eventually decide to "talk about the weather."
Frederic warns the girls of the pirates nearby -- but, before they can flee, the pirates arrive and capture all the girls, intending to marry them. Mabel warns the pirates that the girls' father is a Major-General, who soon arrives and introduces himself. He appeals to the pirates not to take his daughters, which would leave him entirely alone. Having heard of the famous Pirates of Penzance, he pleads for their release on the ground that he's an orphan. The soft-hearted pirates are sympathetic and release the girls, making Major-General Stanley and his daughters honorary members of their band.
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. The Sergeant of Police and his corps arrive to announce their readiness to go forth to arrest the pirates. 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 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, 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 February 29 (in a leap year), it means that technically only five birthdays have passed, 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."
Frederic meets Mabel, and she pleads with him to stay, but he explains that he must fulfill his duty to the pirates until his 21st birthday. He promises to return then and claim her. They agree to be faithful to each other until then, and Frederic departs. Mabel steels herself 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." The police hide on hearing the approach of the pirates, who have stolen onto the grounds, meaning to avenge themselves for the Major-General's lie.
The police and the pirates prepare for the fight. 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. The girls come looking for him. The pirates leap to the attack, and the police rush to the defense; 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.