The Great Wall of China was not built in a single year. It was the work of many centuries, and smaller walls built in the Warring States Period, from 476 to 221 BC, were connected by Emperor Qin Shihuang as a front line defense against invasion.
Originally a system of smaller walls intended to defend against northern nomadic tribes, the Great Wall of China was connected by General Meng Tian on the order of Emperor Qin Shihuang. It was modified, repaired and extended during the subsequent dynasties. The longest section was built between 206 and 220 BC, and the wall was extensively rebuilt during the Ming Dynasty between 1368 AD and 1644 AD.