The opera was composed between June 1881 and April 1883. "Mazeppa"s libretto was based on "Poltava", a narrative poem by Alexander Pushkin. Pushkin based his story on historical events at Poltava, the battle where Tsar Peter the Great defeated Swedish King Charles XII. Pushkin took some creative freedom in order to create powerful characters and grand passions. For example, Kochubey (the wealthy Cossack whose daughter elopes with Mazeppa) actually managed to successfully keep Mariya from him. He turned Mazeppa in to the Tsar four years after Mazeppa asked for her hand.