In 121 BC, Han forces expelled the Xiongnu from a vast territory spanning the Hexi Corridor to Lop Nur. They repelled a joint Xiongnu-Qiang invasion of this northwestern territory in 111 BC. In that year, the Han court established four new frontier commanderies in this region: Jiuquan, Zhangyi, Dunhuang, and Wuwei. The majority of people on the frontier were soldiers. On occasion, the court forcibly moved peasant farmers to new frontier settlements, along with government-owned slaves and convicts who performed hard labor. The court also encouraged commoners, such as farmers, merchants, landowners, and hired laborers, to voluntarily migrate to the frontier.