Caucasian Albania had existed in Southern Dagestan, for most of its history being a vassal under the direct rule of the Parthians and later the Sasanid Persians, but eventually, the majority converted to Islam following the Muslim conquest of Persia, as their overlords did.
In these areas (Southern and Southeast Dagestan), where interethnic conflict was often present, Islam served a unifying role, and it was often the clerical establishment which mediated disputes.
Islam only began to make inroads in Chechnya during the 16th century, and even then was not highly important, with the indigenous Vainakh religion still holding strong.
First of all, the indigenous Caucasian states run by Avars, Kumyks, Lezgins, Laks and others (particularly the widow ruler Pakhu Bike, Queen of the Khanate of Avaria) opposed it as it seemed to take legitimacy away from their own positions.
[4] For these reasons, and other more subtle ones, in most areas the Imamate claimed as its domain, it was, in fact, simply viewed as the lesser evil to Russia.
Parts of the Muslim population started to radicalize due to rapacious Russian activity and taxation and were calling for a Gazawat (Holy War) and the enforcement of Sharia.
The Russians, who at the time ruled over Northern Dagestan, were used to fighting on the open battlefields of Europe in lined formation instead of the thick woods of the Caucasus and so were very unprepared for the guerrilla tactics of the two imams, resulting in a victory for Ghazi and Shamil.
The supreme government body of the Imamate, the State Council (Dīvān) was formed which consisted of Sufi Muslim scholars and students as well as Shamil's military lieutenants, his Naibs.
With their great victory over Napoleon's Grand Army in 1812, the Russian people saw little concern in the petty "Asiatic" resistance occurring on their southern borders.
The Russians countered: General Aleksei Aleksandrovich Velyaminov [ru] launched an assault on the de facto capital of the Imamate, the small settlement of Gimry.
But he continued to rule until 1859, when Emperor Alexander II of Russia offered Shamil a peaceful surrender - he would even be a guest of the imperial palace.
[6]In 1859, Shamil wrote to one of his sons: "By the will of the Almighty, the Absolute Governor, I have fallen into the hands of unbelievers... the Great Emperor... has settled me here... in a tall, spacious house with carpets and all the necessities.
Hotso only had support in Dagestan, and there he carried on his fight (in Chechnya, meanwhile, North Caucasian nationalists of various creeds similarly went into guerrilla war against the Russians).