The Han–Xiongnu War began with Emperor Wu of Han, and the Han colonized the area of the Ordos as the commandery of Shuofang in 127 BCE. Prior to this campaign, there were already earlier commanderies established by Qin and Zhao before they were overrun by the Xiongnu in 209 BCE.