Kowloon Walled City was a tiny, densely populated enclave in Kowloon, Hong Kong, that was established in the 1840s. The city was originally a Chinese fort, but after the Opium Wars, it became a refuge for Chinese immigrants fleeing war and poverty. Over time, the city developed its own system of governance, which was largely based on the rule of the triads, powerful organized crime syndicates.