The Kowloon Walled City dates back to the Sung dynasty of 960-1297 when it was used as a trading post for salt and as a small fort to house the imperial soldiers who controlled the salt trade.
The wall itself was built in 1898 - the year a territorial dispute raged over the city between the British and Chinese governments. The dispute arose from a loophole in the Convention of Peking, a treaty which ceded the New Territories to Britain for 99 years.
Both sides claimed sovereignty over the Walled City and the area was classified a 'no-man's-land'.
It became a lawless enclave and hotbed of criminal activity. It was packed with opium dens, heroin stands, brothels and dog-meat restaurants, particularly during the 1950s and 1960s, with police usually turning a blind eye to illegal activities.
During the Japanese occupation in World War II, the oldest standing part of the Walled City was demolished to use as building material to extend Kai Tak airport.
Chinese refugees flocked to the site during the civil war on the mainland. Rents were low and there were no taxes, visas or licences inside the city.
By 1947, there were 2,000 squatter camps, which gave way to permanent buildings. By 1971, 10,004 residents and 2,185 dwellings were recorded. The population expanded to 35,000 by the late 1980s and it covered 2.7 hectares, giving the appearance of a fortress from the outside.
The Government tried to clear the city several times but failed, as the residents threatened to create a diplomatic incident each time.
The fate of the Walled City was finally determined in January 1987 when the Hong Kong Government and the Chinese Ministry of Foreign Affairs agreed it should be pulled down and turned into a park.
The clearance was carried out in three stages between 1988 and 1991.
More than 11,000 families were compensated and rehoused in a scheme costing $377 million. The $61 million Kowloon Walled City Park now covers 31,000 square metres.