A walled village (Chinese: 圍村) is a type of large traditional multi-family communal living structure found in China, that is designed to be easily defensible. It is completely surrounded by thick defensive walls, protecting the residents from the attack of wild animals and enemies. Usually, people living in the walled village are extended families or clans sharing the same surname. Walled villages are still found in southern China and Hong Kong.
During the Ming and Qing Dynasties, the shore of Guangdong suffered from pirates. The area of Hong Kong was particular vulnerable to pirates' attacks. Winding shores, hilly lands and islands and far from administrative centres made Hong Kong an excellent hideout for pirates. Villages, both Punti and Hakka, built walls against pirates. Some villages even protected themselves using cannons. In Punti Cantonese, Wai (圍, Walled) and Tsuen (村, Village) were once synonyms.
The ancestral hall was the most important building in a village. It housed the soul tablets of the ancestors of the villagers. Villagers went there to worship their ancestral halls would also be used as schools.