Moscow teenager Stepan Govorov failed the annual history exam. As a result, instead of a vacation in Turkey, Stepa's parents send him to his grandmother in a village near Rostov.
Having come into conflict with local teenagers, Stepa accidentally falls into a village well and falls into the past, into a Cossack village in 1612 during an attack on it by the Crimean Tatars. After the fight, Stepa is mistaken for a spy and thrown into a pit. In the morning, at the Cossack circle, the Cossacks decide to execute him.