<human>:  Why was the Great Wall of China built?
<bot>: The Great Wall was built to protect the Chinese Empire from invasion. The Great Wall was built in the 3rd century BC by the Qin Dynasty to keep out the Xiongnu, a nomadic people from the north who had invaded China in the 3rd century BC. The Great Wall was built with bricks made from mud and straw, and the bricks were then covered with stones and earth. The Great Wall was built with an average length of 6.5 miles, and was built in sections, which were connected by smaller walls and fortifications.