History of the town of Yasy - Turkestan
The modern Turkestan is referred to the ancient Kazakh towns. A number of the well-known political events that took place in Kazakhstan and Central Asia during the Middle Ages are related to this town, and it is reflected in the written historical sources.
The history of the medieval towns of the South Kazakhstan - Shavgar and Yasy - that in certain historical periods were the administrative and economic centres of the Turkestan oasis - is closely interwoven with the history of Turkestan. At first Shavgar was the main town, then - Yasy (it was the name of Turkestan before the XVI century).
Before the VIII century Shavgar was dependent on the Turkic and West-Turkic Kaghanates (552-702).
At the beginning of the VIII century the region of Shavgar was included into the western borders of the Turghesh Kaghanate (702-756), the possession of the Turghesh Kaghanate extended to the middle reaches of the Syr Darya river. Then the Arab conquest of Central Asia and South Kazakhstan started. After the conquest of Mawarannahr, the Arabs began to move to the areas near Syr-Darya and Talas.
At the second half of the VIII century the Karluks occupied the eastern part of the area near Syr-Darya and the Talas valey. The Karluk dzhabgu (ruler) was obliged to pay a tribute, but often he broke his obligation, and the Arabs were to undertake punitive expeditions to the dependent territories. Under Al-Mamun, the governor-general of Khorasan (809-818) the campaign to the area of Tarbad was taken (the joint name for the Shavgar and Farab regions) that was the frontier territory of the Arabs: "Also from the region of Tarbad (the visier al-Fadl) sent everything that he had demanded of Farab and Shavgar. And he made efforts to occupy the region of Otrar; he killed the head of the frontier territory and captured the sons and the wives of the Karluk dzhabgu, after he had forced the dzhabgu himself to take a flight to the land of Kimaks ".
During a period of the political supremacy of the state of Samanids in Central Asia (820-999) Shavgar has been included into its north-east borders.
In the IX century the areas neighbouring to Shavgar were dependent on Karluks, and at the beginning of the X century - to the Oghuz tribes. The Oghuz state was founded at the end of the IX - the beginning of the X centuries in the basin of the lower and middle reaches of the Syr Darya river and in the adjourning steppes of the West Kazakhstan. The state existed up to the middle of the XI century, rapidly increasing its possessions.
The time of highest flourishing of Shavgar was the IX-X centuries. It was situated on the juncture of the agricultural and nomadic cultures that promoted to its rapid growth and turning into the large handicraft and trade centre. Here is a description of Shavgar by al-Maxidi at the end of the X century: "Shavgar is a large town with an extended rustrak (stronghold), there is a wall around the town. On the edge of the market there is a mosque. It is situated far off the highway".
After the fall of the state of Samanids, their possessions were shared between Karakhanids and Gaznevids with a frontier on the Amu Darya river. The state of Karakhanids (942-1212) included areas located in the basin of Syr Darya, the areas Shavgar, Otrar, Isphidzhab, Semirechie, East Turkestan. At the end of the X - the beginning of the XI centuries Shavgar was probably a composite part of one udels (independent domain) of Karakhanids. At the beginning of the second quarter of the XI century South Kazakhstan and Central Asia were subject to invasions of Kara-khitays (kitans). After the armed forces of Karakhanids and Seldjuqs were crashed (1137 and 1141 respectively), Kara-kitays conquered the lands of the Karakhanid state. The Karakhanids turned out to be the vassals of Kara-kitays.
At the end of the XI - the beginning of the XIII century the state of Kwarazm Shakhs was struggling against Kara-kitays. The Kwarazm shah Mukhammed ibn Tekesh took several campaigns against areas near Syr Darya, and occupied Otrar. In 1210 he crashed the army of Kara-kitays near Taraz. Thus the state of Kwarazm Shahs adjourned the areas of South Kazakhstan on the right bank of Syr Darya and up to Taraz inclusively.
The issue of coins in the towns of Yasy and Otrar became the political action of Mukhammad declaring the including of the strategically important region near Syr Darya into the state of Kwarazm Shahs. But submission to the Kwarazm Shahs did not last for a long time.
Though Kwarazm Shahs conquered areas in the middle reaches of Syr Darya, the historical sources describing these events do not mention Shavgar. Moreover, beginning from the XII century the name of Shavgar has been disappearing from the medieval historic-geographic literature.
For the first time the name Yasy appeared in the written sources in the middle of the XIII century in relation to the trip of the Armenian Tsar Getum to the quarters of the Mongolian Khans Batyi and Munke in 1255. Yasy as "Ason" was mentioned among other large towns passed by the embassy of Getum on its way back.
At the beginning of the Middle Ages a large settlement or a small town, probably, existed on the place where then Yasy would be built. This settlement or town was smaller then the capital of the region, it was dependent on Shavgar and included into its territory. Some researchers consider Yasy to be the suburbs of the ancient Shavgar, but the most probably it was the satellite town.
From the XII century - a period of the Shavgar fall, the importance of Yasy changed. The economic centre was shifted to Yasy, as it was that time the largest settlement of the agricultural environment. Yasy became the centre of the Shavgar region. To some extent, it may be explained by the fact that in the XII century the Turkic Sufi preacher Ahmed Ata Yasawi was buried at one of cemeteries in Yasy. So, Yasy became well-known among the neighbouring population as the settlement with a holy place.
In September 1219 the Mongolian conquest of Central Asia started. After submitting of Semirechye, the Mongols turned their eyes to Syr Darya to move to Otrar. Almost all towns near Syr Darya showed stubborn resistance to the conquerors. The movement of the Mongols was accompanied by destroying of towns, mass extermination of people, the total devastation of regions. The name Yasy is not mentioned in the sources describing conquests of Chingis Khan. It is supposed that the town did not offer any resistance to the Mongols.
After division of the Mongolian State into ulus (independent domains), Yasy and the territory of the South and South-East Kazakhstan were included into the Chagatai ulus.
From the beginning of the XIV century the rulers of the Ak Horde - the state isolated from the Golden Horde and occupied the eastern part of the Djuchi ulus - began to pretend to these territories. Availing themselves of the difficult internal situation in the Chaghatayid state, the Ak Horde khans occupied the lower and middle reaches of Syr Darya with the towns Yasy, Sauran, Yangikent, Otrar and others.
In 70-ies of the XIV century Timur, the ruler of Central Asia made efforts to conquer the areas near Syr Darya belonging to the Ak Horde. Having occupied these lands, Timur tried to strengthen his power This enormous state pursued the policy aimed at strengthening the power of Emir. One of the directions of this policy was the construction of the monumental public and cult buildings (mosques, mausoleums, medrese) including the region near Syr Darya, where towns became the important outposts on the northern frontiers of the Timur's possessions. Timur strove for uniting of the conquered nations not only by territorial integrity, within one state, but also by developing a common outlook.