H.M.S. Pinafore ; Or, The Lass That Loved a Sailor is a comic opera in two acts. The fourth operatic collaboration between composer Arthur Sullivan and librettist W. S. Gilbert, it premiered at the Opera Comique in London, England, on 25 May 1878 and ran for 571 performances.
Set aboard the British ship H.M.S. Pinafore, the captain's daughter, Josephine, is in love with sailor, Ralph Rackstraw. Her father intends marrying her to Sir Joseph Porter, the First Lord of the Admiralty, however. Josaphine at first abides by her father's wishes but Sir Joseph's advocacy of the equality of humankind encourages Ralph and Josephine to declare their love for each other. The Captain discovers their plan to elope but a surprise disclosure changes things dramatically.