 The office of Viceroy of Shaan-Gan originated in the early Ming dynasty with the garrisoning of military forces in three towns along the northern border of Shaanxi Province.The three garrisons were called ""Xunfu" of Yansui" (延綏巡撫), ""Xunfu" of Ningxia" (寧夏巡撫) and ""Xunfu" of Gansu" (甘肅巡撫).In 1497, when the Mongols of the Northern Yuan dynasty made intrusions across the border, the Hongzhi Emperor put Wang Yue (王越) in charge of coordinating military actions in Shaanxi, Yansui, Ningxia and Gansu.