In 1654 the Cossack Hetmanate came under military protectorate of the Tsardom of Muscovy in accordance with the Treaty of Pereyaslav and in 1664, during the siege of Hlukhiv, the Russo-Cossack garrison of the town successfully defended against a superiour Polish army which suffered great losses during the following retreat.
In 1708 after realizing that Ivan Mazepa sided with Carl XII, Peter the Great order to destroy Baturyn and transfer capital to Hlukhiv.