The Seljuks quickly relinquished direct control over Kars and it became a small emirate whose territory corresponded closely to that of Vanand, and which bordered the similarly created but larger Shaddadid emirate centered at Ani. The Kars emirate was a vassal of the Saltukids in Erzurum, whose forces were effective in opposing Georgian attempts at seizing Kars. Thus, it was only in 1206 that Zakare of the Zakarids-Mkhargrzeli succeeded in capturing Kars, joining it to their fiefdom of Ani. It was conquered in 1242 by the Mongols; was regained by Georgian Kingdom during the reign of George V the Brilliant (1314–1346), it remained part of the Kingdom before its disintegration, which then passed into the hands of Georgian Atabegs belonging to the House of Jaqeli. In 1387 the city surrendered to Timur (Tamerlane) and its fortifications were damaged. Anatolian beyliks followed for some time after that, until it firstly fell into the hands of the Kara Koyunlu and subsequent Ak Koyunlu. After the Ak Koyunlu, as it went naturally for almost all their former territories, the city fell into the hands of the newly established Safavid dynasty of Iran, founded by king Ismail I. Following the Peace of Amasya of 1555 that followed through the Ottoman-Safavid War of 1533-1555, the city was declared neutral, and its existing fortress was destroyed. In 1585, during the Ottoman-Safavid War of 1579-1590, the Ottomans took the city alongside Tabriz. On June 8, 1604, during the next bout of hostilities between the two archrivals, the Ottoman-Safavid War of 1603-1618, Safavid ruler Abbas I retook the city from the Ottomans. The fortifications of the city were rebuilt by the Ottoman Sultan Murad III and were strong enough to withstand a siege by Nader Shah of Persia, in 1731. It became the head of a sanjak in the Ottoman Erzurum Vilayet. In August 1745, a huge Ottoman army was routed at Kars by Nader Shah during the Ottoman-Persian War of 1743-1746. As a result, the Turks fled westwards, raiding their own lands as they went.