The libretto for Mazeppa was written by Viktor Petrovich Burenin, based on Pushkin's poem Poltava. Tchaikovsky made changes to it, however, replacing Burenin's text with Pushkin's wherever possible, without losing the former's focus on the main character, Mazeppa, and without embracing the latter's greater historical scope. The opera is cast is three acts and six scenes, its story set in early-eighteenth century Russia. Maria, daughter of the wealthy Cossack Kochubei, declares her love for the much-older Mazeppa. Andrei then announces his passionate love for her. Mazeppa asks of Kochubei his daughter's hand, but is denied. Kochubei's scheme to reveal Mazeppa's anti-tsarist intrigues to the Tsar backfires, landing him in a dungeon. Meanwhile, Mazeppa reveals his plans to Maria, who knows nothing of her father's imprisonment. Liubov, Maria's mother, apprises her of her father's plight. Maria hurries to save her father, but arrives moments after he is beheaded. During the Battle of Poltava, Andrei ambushes Mazeppa, who then shoots him. Maria comforts the dying Andrei, while Orlik drags Mazeppa off.