Mirza Muhammad Khan II

His reign saw the Khanate's complete incorporation to Quba, to the point that Fatali Khan invited a Russian garrison to be stationed in Baku in 1785 in place of Mirza Muhammad.

[2] Mirza Muhammad fled to Quba with his family, including his wife and his mother.

In response, Ahmed khan mobilized troops and marched on Baku to restore Mirza Muhammad.

Confused, Gudovich ordered counter-admiral Pyotr Shishkin to resolve the problem to Russia's benefit.

Huseyngulu made a night attack on Balakhani with reinforcements from Shirvan in 1795 and forced Mirza Muhammad to take refuge in Quba yet again.

Mirza Muhammad took forces from Shaykhali and positioned on Absheron, blocking trade and supply routes.

Soon through Mostafa khan's help, the cousins made peace and Mirza Muhammad went back to Quba, while retaining his income from Baku oil fields.

However, Agha Mohammad's assassination and Huseyngulu khan's fast arrival ruined his plans.