The Hotak dynasty ( ) was an Afghan monarchy founded by Ghilji Pashtuns that briefly ruled portions of Iran and Afghanistan during the 1720s. It was established in April 1709 by Mirwais Hotak, who led a successful revolution against the declining Persian Safavid empire in the region of Loy Kandahar ("Greater Kandahar") in what is now southern Afghanistan. In 1715, Mirwais died of natural causes and his brother Abdul Aziz succeeded him. He did not reign long as he was killed by his nephew Mahmud, who deposed the Safavid shah and proclaimed his own rule over Iran. Mahmud in turn was succeeded by his cousin Ashraf following a palace coup in 1725. Ashraf, however, did not retain his throne for long, as the Iranian conqueror Nader-Qoli Beg (later Shah), leading the resurgent Safavid banner, defeated him at the Battle of Damghan of 1729. Ashraf Hotak was banished to what is now southern Afghanistan, confining Hotak rule to a small corner of their former empire. In 1738, Hotak rule ended when Nader Shah defeated Ashraf's successor Hussain Hotak after a lengthy siege of Kandahar. Subsequently, Nader Shah began re-establishing Iranian suzerainty over regions lost decades before to Iran's archrivals—the Ottoman and Russian Empires. The Shi'a Safavids ruled Loy Kandahar as their easternmost territory from the 16th century until the early 18th century. At the same time, the native Afghan tribes living in the area were Sunni Muslims. Immediately to the east was the powerful Sunni Mughal Empire, who occasionally fought wars with the powerful Safavids over the territory of southern Afghanistan. The Khanate of Bukhara controlled the area to the north at the same time. By the late 17th century, the Safavids started to decline. With the death of Shah Abbas in 1629, succeeding Safavid rulers were less effective and caused the empire to decline. On 29 July 1694, Shah Suleiman died and Sultan Husayn took the throne. Under his reign the problems worsened. Husayn barely left the palace during his reign, not an uncommon aspect of many later Safavid Shahs.