Answered by Gary from Iran | Apr. 22, 2015 04:20
It took more than 2000 years to build the wall. You can regard that the wall was completed in Ming Dynasty (1368-1644). The wall was extended and rebuilt in previous dynasties. However, the rulers of Qing Dynasty almost didn't order to build the wall.
I don't know if you ever heard of Battle of Shanhaiguan Pass. Li Zicheng once led his army to defend against Qing Army at Shanhaiguan Pass. However, Wu Sangui who guarded at the pass chose to surrender. As a result, Wu joined together with Qing army to defeat Li Zicheng. Finally, Qing army passed the pass and entered Beijing on June 6 in 1644 and chose Beijing as its new capital.