Pushkin began writing the poem in 1817, while attending the Imperial Lyceum at Tsarskoye Selo. He based it on Russian folktales he had heard as a child. Before it was published in 1820, Pushkin was exiled to the south of Russia for political ideas he had expressed in other works such as his ode to "Freedom". A slightly revised edition was published in 1828. The poem was the basis of an opera of th...