During this time, Hussein-khan, a native of the region, had spent time in Persia and adopted Shia Islam, creating favor in the eyes of the Shah, who granted him rule over both the Quba and Salyan khanates.