The prefecture (zhou 州) of Yizhou 伊州 was one of the three prefectures the Tang empire 唐 (618-907) set up in the Western Territories 西域 (the others being Xizhou 西州 and Tingzhou 庭州). It included the three districts (xian 縣) of Yiwu 伊吾 (Türkic name Hami), Rouyuan 柔遠 and Nazhi 納職. Yiwu was located in the place of modern Hami 哈密, Xinjiang. In 630 the prefecture was still called Xiyi 西伊, but two years later the word "western" (xi 西) was dropped. During the mid-8th century the area was for a short time administered as commandery (jun 郡) of Yiwu.
Yiwu was a large oasis in the desert region and therefore an important place for the supply of the Chinese armies already during the Han period 漢 (206 BCE-220 CE). The military agro-colonies (tuntian 屯田) in Yiwu at that time were overseen by a commander for grain supply (yihe duwei 宜禾都尉). Yiwu was from the late 6th century on inhabited by Türkish tribes that submitted to the Tang Pacification Commissioner-in-Chief (anfu dashi 安撫大使) Li Daliang 李大亮. In 710, a garrison was built up in Yiwu with a strength of 3,000 men.
In 762 the prefecture fell into the hands of the Tibetans and could only be reoccupied by the Tang armies under Zhang Yichao 張議潮 for a short time in 850.