H.M.S. 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, on 25 May 1878 and ran for 571 performances, which was the second-longest run of any musical theatre piece up to that time. H.M.S. Pinafore was Gilbert and Sullivan's fourth operatic collaboration and their first international sensation.