HMS Pinafore; or, The Lass That Loved a Sailor is a comic opera in two acts, with music by Arthur Sullivan and a libretto by W. S. Gilbert. It opened at the Opera Comique in London, England, on 25 May 1878 and ran for 571 performances, which was the second-longest run of any musical theatre piece up to that time. HMS Pinafore was Gilbert and Sullivan’s fourth operatic collaboration and their first international sensation.
The story takes place aboard the British ship HMS Pinafore. The captain’s daughter, Josephine, is in love with a lower-class sailor, Ralph Rackstraw, although her father intends her to marry Sir Joseph Porter, the First Lord of the Admiralty.