Towards the end of the Ming, the Great Wall helped defend the empire against the Manchu invasions that began around 1600. Even after the loss of all of Liaodong, the Ming army held the heavily fortified Shanhai Pass, preventing the Manchus from conquering the Chinese heartland. The Manchus were finally able to cross the Great Wall in 1644, after Beijing had already fallen to Li Zicheng's rebels.
Under Qing rule, China's borders extended beyond the walls and Mongolia was annexed into the empire, so constructions on the Great Wall were discontinued. On the other hand, the so-called Willow Palisade, following a line similar to that of the Ming Liaodong Wall, was constructed by the Qing rulers in Manchuria. Its purpose, however, was not defense but rather to prevent Han Chinese migration into Manchuria.