the early 14th century in Kumukh along there were several mosques. Campaign of Tamerlane In 1395 Tamerlane moved to Kaitag. Shamkhal with an army of 3,000 persons attacked Tamerlane in the neighborhood of Akusha-Dargo. Nizameddin Shami reported that "Gazi-Kumuk" was an ally of the Golden Horde and that "shamkhal of Gazi-Kumuk had a custom to fight the unbelievers" that Tamerlane wanted to put to his use. Despite this Tamerlane marched against the shamkhal and after several months of siege and battles captured fortress Kuli and Tayus. Sharafuddin Yezdi, Tamerlane's court historian, wrote about the capture of "Kazi-Kumuk": "Heavy resistance is overcome, fortresses captured, inhabitants defeated, shamkhal was killed himself". Strengthening of shamkhalate in the 15th and 16th centuries Authority In the 15th century Shamkhalate became the largest political and Islamic center of southern Dagestan and in that connection shamkhal assumed the functions of the ruler of entire Dagestan and was named as "padishah", "wali" and "tsar". Academician M. Hasanov wrote: "Shamkhalate reached its height in the 15th century. Sources name shamkhals "walis" i.e. the rulers of entire Dagestan. The title did not match the reality. Shamkhal never managed to be the ruler of entire Dagestan. The emergence of the term speaks of the strengthening of shamkhalate". Government Gazikumukh Shamkhalate was ruled by the supreme council or divan where the viziers (advisers), qadis (Islamists), ameers (warlords) and shamkhal (ruler) were present in the meetings. Federalism The possessions of Dagestan were prone to political independence and entered into alliances with the rulers in their own interests, such as the need to defend by united forces against the invaders. In the 15th century shamkhal was in alliance with such possessions as Agul, Kurakh, Akhti, Rutul, Tsakhur, Andalal, Andi, Gidatl, Gotsatl, Karakh, Kusrakhi, Tsudakhar, Gubgen, Akusha, Kubachi, Tarki, Bujnak, Andirey and Tumen, that were managed by Jamaats, Qadis or Beks. Army According to Andunik-nutsal, the army of shamkhal numbered up to 100 thousand men. Turkic chronicler Mehmet Efendi wrote about Dagestanis that "when their security is threatened, under the banner of shamkhal there gathers one hundred thousand army of horsemen and footmen. It's a known fact". Aggression of Iran At this time the Persians decided to raise an army, seize Shirvan and Dagestan and "create a large Shi'ite state". In 1456 Iran's Safavid ruler Shaykh Junayd (1447-1456) was defeated and killed on the banks of the Samur river. In 1488 Sheykh Haydar (1456-1488), the