The Siege of Kandahar lasted from 1605 to 1606. The Mughals had obtained the city of Kandahar in 1595, after the Mughal army advanced to the city's governor, Moẓaffar-Ḥosayn Mirzā, and negotiated with him a surrender. The Safavid ruler, Shah Abbas, was shocked by the loss of the important fortress but as main Iranian concerns lay with the equally powerful Ottomans at their westernmost territories, he abstained from military action, preferring to negotiate a settlement. When Emperor Akbar died on October 27, 1605, the Safavid governor of Herat, Hosayn Khan, moved to recapture the city on behalf of the Safavids while the Mughals were distracted from other matters. The city, defended by governor Šāh Beg Khan, held out the Safavid siege until the next year when the new Emperor, Jahangir, sent an army that lifted the siege. Abbas repudiated Hosayn's actions in a letter to Jahangir, and both sides reestablished normal relations, though Kandahar would remain a controversial affair between both parties.