Quba Khanate
After the death of Fatali Khan, his short-lived quasi-independent rule collapsed. His successor, Ahmed Khan, ruled for only two years and died in March 1791 after whom the new khan of Quba became his brother Sheikh Ali Khan. As a result of dissatisfaction with the policies Sheikh Ali Khan, Derbent once again became an independent khanate, which in May 1799 received its own khan again, and this was the youngest son of Fatali Khan, named Hasan Aga. In 1802 and Hasan Khan died and Sheikh Ali Khan resubjugated the possession of Derbent to the Quba Khanate.