The Kingdom of Fergana describes a former state which existed probably between the 3rd century BC and 6th century AD in what is now the Ferghana Valley of eastern Uzbekistan. It was probably the area known in classical Chinese sources as Dayuan.
In 329 BEC, Alexander the Great founded Alexandria Eschate (Farthest Alexandria) to the southwest of the Jaxartes river valley, site of the modern Khokand in Uzbekistan. The city probably remained in contact with the Greco-Bactrian Kingdom. It is believed that the Greeks of Alexandria Escate arrived in Urumqi and Kashgar in Xinjiang and had their first contacts with the Chinese towards 220 BC.
Statues of Greek soldiers have been found in China, and Strabo indicated a belief that the Greeks extended their territory to the country of the Seres (Chinese) and the Phryni.
Chinese sources state that before the Muslim conquest, a Chinese embassy led by Zhang Qian visited the land of the dayuan or ta-yuan in 128 BC. An Indian dynasty, perhaps of Greek origin, ruled the country; the Chinese called it the country of the Celestial Horses, and by 104 BC they were at war with Fergana.
In the 6th century AD, the Turks established a khanate in Fergana. Following that, various khanates reigned over the area: