Molla Panah Vagif

Molla Panah Vagif eventually moved to Shusha, capital of the Karabakh Khanate, and founded his madrasa in the Saatli neighborhood of the town, serving 17 families.

[9] In 1769, he was invited to the court of ruler Ibrahim Khalil Khan, who had heard of Panah's ability to predict the time of the lunar eclipse, and was appointed eshik aghasi (person in charge of foreign affairs) of the khanate after conversion to Shiism from Sunni Islam.

He was described by authors such Mirza Jamal Qarabaghi as "A cautious and perfect vizier who found great fame in Iran and Rum" and by Mir Mehdi Khazani as the most trusted officer of Ibrahim Khan.

He took part in the development and planning of Shusha, played an important role in establishing political relations between the khanate and Georgia and Russia.

He also played an important role in organizing the defence of Shusha during the incursions of Agha Mohammad Shah Qajar of Persia in 1795 and 1797.

The historian Mirza Adigozal bey records the following possibly apocryphal tale: during the 1795 siege of Shusha, which resisted stubbornly despite the overwhelming numbers of Agha Mohammad's army, the shah had the following couplet by Urfi, the Persian-Indian poet, attached to an arrow and shot behind the walls of the city:[5] زمنجنیق فلک سنگ فتنه می بارد تو ابلهانه گریزی به آبگینه حصار؟ Lunatic!

When the message was delivered to Ibrahim Khalil Khan, the ruler of Shusha, he called upon Vagif, his vizier, who immediately wrote the following response on the reverse of the message: گرنگهدار من آنست که من می دانم شیشه را در بغل سنگ نگه میدارد If my protector is the one that I know, [he] would protect the glass alongside the most solid stone.

Agha Mohammad Shah invaded Karabakh a second time in 1797, after the Russian armies that briefly occupied the Caucasus withdrew upon the death of Catherine II.

Vagif's poems have had a great influence on Azeri folklore and many of them are repeatedly used in the folk music of ashiks (wandering minstrels).

Vagif's mausoleum in Shusha before the occupation of the town by Armenian forces
Azerbaijani President Ilham Aliyev in front of ruined mausoleum