The Great Wall of China was built from the 3rd century B.C.E to the 17th century AD, in order to prevent the Mongols from entering and invading China.
The Great Wall is a series of stone and earthen fortifications in China, built, rebuilt, and maintained between the 5th century BC and the 16th century to protect the northern borders of the Chinese Empire during the rule of successive dynasties. Several walls, referred to as the Great Wall of China, were built since the 5th century BC. The most famous is the wall built between 200 BC - 220 BC by the first Emperor of China, Qin Shi Huang; little of it remains; it was much farther north than the current wall, which was built during the Ming Dynasty.
Walls were being built in order to protect the Chinese empire as early as the 7th century BC. However, the collection of walls which have become known as The Great Wall of China were mainly built from 220 to 206 BC.