While the Sāmānides were thus harassed by the powerful Daylamites in the west, by the growing power of Sabuktagin in the south, and the fear of insubordination in their own states, a force still more formidable had arisen on their northern frontier, where a Turkish state had been founded which extended from Kāshghar to the Sea of Aral. The relations of this state with its southern neighbours were at first of a peaceful and even friendly character; but when the nomads perceived that Iranian authority was on the wane they began to cast longing eyes across the Jaxartes. They probably belonged to the tribe of _Uïghūr_, which had been the first to separate from the main body of the Turkish race and settle down in a home on the slopes of the Tien-shan.[244]
According to the Mohammedan historian Juvaynī,[245] the Uïghūrs originally came from the valley of the Orkon River. The first king whose name has come down to us was Būkū Khān, whom tradition has identified with the great Afrāsiyāb.[246]
Būkū Khān, having learnt in a dream that he would possess the entire world, assembled his troops and sent his brothers to wage war against the Mongols, Kirghiz, Tanguts, and Khitāys.[247] They returned to their dwelling-place with great booty, and founded the city of Urdu Bālik. Būkū Khan again dreamt that a piece of jade was given him with the assurance that as long as he preserved it he would rule the world. The prospect induced him to turn his arms to the west and enter Turkestān, where he built the city of Balāsāghūn.[248] We know from Chinese sources that these Uïghūrs[249] had their abode in the seventh century in the north-west of Mongolia; that in the eighth century they dwelt near the place where, in the five hundred years later, the Mongols built Karakorum. In the ninth century their empire in Mongolia was destroyed by the Kirghiz, when they were dispersed, and apparently split into two parties. The eastern branch came into contact with Chingiz Khān. After and thenceforward they appear in the Mongol-Chinese annals as under the name of Wei-wu-rh.[250] Of the Western Uïghūrs little is known, but they may be identified with the Eastern Turks of Mohammedan authors of the eleventh and twelfth centuries.[251]