In 1514 and 1517, Dayan Khan led Mongol troops to invade China, causing great damage. He built forts in Xuanhua and Datong and stationed 15000 troops on Ming territory. Culminating in the Battle of Yingzhou () in 1517, Dayan Khan was killed in the battle. From 1545, Xuanda Governor Weng Wanda () began building Xuanfu Great Wall, reaching 462 li (231 km) next year. In 1545, he built Great Walls again, reaching 169 li (84.5 km), effectively defending the area of Mongol cavalry's invasion.