Although Panah Ali khan has been in conflict with Nader Shah, the new ruler of Persia, Adil Shah, issued a "firman (decree)" recognizing Panah Ali as the Khan of Karabakh. Less than a year after Shusha was founded, the Karabakh Khanate was attacked by Mohammad Hassan Khan Qajar, one of the major claimants to the Iranian throne. During the Safavid Empire Karabakh was for almost two centuries ruled by Ziyad-oglu family of the clan of Qajars (of Turkic origin), and therefore, Muhammed Hassan khan considered Karabakh his hereditary estate.