According to Mirza Jamal Javanshir Qarabaghi (1773–1853), the author of the Persian-language text "History of Karabakh", one of the most significant chronicles on the history of Karabakh in 18th-19th centuries, the Karabakh nobility assembled to discuss the danger of invasion from Iran and told Panah Ali Khan, "We must build among the impassable mountains such an inviolable and inaccessible fort, so that no strong enemy could take it." Melik Shahnazar of Varanda, who was the first of the Armenian "meliks" (dukes) to accept the suzerainty of Panah Ali Khan and who would remain his loyal supporter, suggested a location for the new fortress. Thus, Panahabad-Shusha was founded.