The mediaeval city was known as Cuba City, according to the studies focused on Arab written documents dating from the VII to X centuries. It was located along the old caravan road linking Kashgar and the Fergana Valley. Once Cuba was the second-largest of its kind in the area after the ancient Ferghana Valley capital, Ahsiket, but in the late 13th century the Mongolian invasion ruined the city.