As part of the treaty ceding the New Territories to the UK in 1898, China was allowed to keep a garrison fort in Kowloon under the proviso it didn’t interfere with the British defence of the Hong Kong. After the Japanese occupation of HK in World War 2, the Chinese never came back to it, and the British didn’t really want to have anything to do with it, so the City became a hotspot for opium dens, brothels and criminals. High construction during the 60s and 70s led to the City becoming the most densely populated area on Earth, with at least 33,000 (and some estimates of up to 50,000) people living in an area the size of only 6.5 acres (0.01 square miles) – buildings were packed so tightly that even during the day, no sunlight could be seen at ground level in the alleyways.
The Walled City had a population density of approximately 1,255,000 inhabitants per square kilometre (3,250,000 /sq mi) in 1987. For comparison, Hong Kong as a whole (itself one of the most densely populated areas on earth) had a population density of about 6,700 inhabitants per square kilometre (17,000 /sq mi) as of July 2009.
After the Sino-British agreement to return Hong Kong was made in the 80s, it was decided that the City would be demolished, and has since been replaced by a lovely little park, which I visited last summer. Located 5 minutes from Lok Fu MTR station, there’s now a small museum of the history of the Walled City in the centre, surrounded by traditional Chinese gardens.