The film is based on actual historical events. It is Russia during the reign of Peter I. It is a time of the empire's complex formation, bloody feuds, and external enemies' encroachments. At this time, Ivan Demarin, a young officer of Tsar Peter's new guard, is sent to Siberia, to a border town of Tobolsk, on the Tsar's assignment. Here, Ivan meets his first love and, together with his regiment, finds himself drawn into a conspiracy of the local princes, who are hunting after the Yarkand gold. His fortress is surrounded by the hordes of wild Dzungars, and there is nowhere to expect help to come from.