After the fall of the Yuan dynasty in 1368, pockets of Yuan loyalists retreated to the northeast.
In 1388, the Hongwu Emperor established contact with three tribes of Ilan Tumen in modern Yilan County near the confluence of the Mudanjiang River and the Songhua River.