Once common throughout China, walled villages can still be found in southern China and Hong Kong. Most of the walled villages in Hong Kong are located in the New Territories. In Punti Cantonese, Wai (围, Walled) and Tsuen (村, Village) were once synonyms, hence most place names which include the word 'wai', were at some point in time a walled village.
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 with cannons. Walled villages in Hong Kong are characterized by row houses arranged in a square or rectangular block, where the parallel rows of houses are separated by narrow lanes.