In 1598, Kazakh Taukeel Khan was at war with the Khanate of Bukhara. The Bukhara troops sent against him were defeated by Kazakhs in the battle between Tashkent and Samarkand. During the reign of Yesim-Khan, a peace treaty was concluded between Bukhara and Kazakhs, according to which Kazakhs abandoned Samarkand, but left behind Tashkent, Turkestan and a number of Syr Darya cities.