Shirvanshahs
The role of Shirvanshah state in national development of Azerbaijan (especially of northern Azerbaijan) is hard to underestimate. It was in a continuing existence as independent or vassal state, from 861 until 1539; longer than any other dynasty in Islamic world. There are two periods of independent and strong Shirvan state: first in XII century, under sultans Manuchehr and Ahsitan who buid the stronghold of Baku, and second in XV century under Derbendid dynasty. In XIII and XIV Shirvan was a vassal of stronger Mongol and Timurid empires.
Shirvanshahs Halilullah I and Farrukh Yassar resided over most successful period in a history of Shirvan. Architerctural complex of "Shirvanshah palace" in Baku , that was also a burial site of the dynasty and Halwatiyya Sufi khaneqa was buid during the reign of those two rulers in mid XV centuries. The Shirvanshah rulers were more or less orthodox Sunni, and thus opposed to heterodox Shi'ism of Safavid Sufi order. In 1462 Sheykh Junayd, the leader of Safavids was killed in battle against Shirvanishans, near town of Khachmaz - an event that Safavids never forgot