HONG KONG -- Unlicensed dentists and doctors with no formal training openly see patients in their shopfront offices in the dank little alleyways. But nobody tries to close them down.

Cat-size rats scurry over the miles of leaky rubber hose that hang over the streets, bringing water to residents by illegally tapping into the city's water supply. But no city official complains.

Buildings have been built so close together that up around 12 stories, they meet. Rare is the ray of light that makes it all the way down to the street.

Welcome to Hong Kong's Walled City, a dark, maze-like slum, which because of a century-old dispute between Britain and China, grew into a unique example of urban disorder. Allowed to develop without interference from so much as a plumbing inspector, the seven-acre enclave just across the street from Hong Kong's international airport turned into an unrestricted ghetto of opium dens, brothels, gambling parlors and unlicensed medical practitioners.

With the signing of the 1984 agreement between Britain and China returning Hong Kong to Chinese control, however, both sides began to show a willingness to finally lay the sensitive issue to rest. What's left to do now is a vast urban clearance program: the leveling of what the Chinese call Hak Nam, the "city of darkness."

Hong Kong announced in 1987 it would destroy the Walled City and turn the area into a public park. One hour after the announcement, hundreds of Housing Department employees backed by police marched into the slum, sealed off some 85 entry points into the district and registered all inhabitants. Hong Kong plans to spend an estimated $350 million to demolish the site and compensate property and business owners.

Just under half of the 33,000 residents have been resettled in government housing elsewhere in Hong Kong. Officials estimate it will take at least another two years to evacuate the entire area, which is crammed with more than 350 jerry-built buildings up to 14 stories high.

Once emptied, the city will probably be cleared by controlled dynamite explosions. Clearance by one massive blast was proposed but discarded to save the district's few valuable relics, which include a Ching dynasty magistrate's house and two Ching cannons.

The bizarre history of the slum began in 1898, following the Opium Wars, when London forced China to lease it the New Territories, a 165-square-mile tract on the Chinese mainland across the harbor from Hong Kong island, which had already been ceded to the British. London initially agreed that China could retain one garrison in the tract, in Kowloon.

A year later, after a local uprising, Britain reclaimed the fortification. Chinese officials left, but Beijing never recognized London's control over what is now the Kowloon Walled City.

Japanese occupiers tore down the walls of the city during World War II, but the name stuck. Hong Kong authorities have tried three times to clear it -- most recently in 1962 -- but each time met heavy resistance from residents backed by Chinese authorities.

In 1948, an attempt to evict 2,000 squatters was abandoned after thousands of mainland Chinese sacked and burned the British consulate in Canton. London backed off again in 1962 after Mao Zedong's regime bitterly attacked a cleanup proposal.

Although Beijing and London have claimed to own the Walled City, neither tried to police it for years for fear of causing a diplomatic incident. The result was a jurisdictional no man's land, which became a magnet for illegal immigrants from China and a haven for criminal activity.

"The opium addicts used to come here and eat sweet soup," said Mo Keung Lam, pointing to an abandoned open-air stove on the corner of two narrow alleys. "You could get dog soup over there, the blue movie place was down there, and on both sides of the street were the gambling parlors. This was a famous street."

Lam was 12 years old when his mother left China and her husband in 1950 and came to Hong Kong in search of a better life for her and her six children. He lived in the Walled City until he was 40, becoming an opium addict in his early 20s. "There was nothing to play when we were kids," Lam said. "We just watched the men going to prostitutes and the people taking drugs.

"It was safe to smoke the opium here," said Lam, who would buy his drugs from members of Hong Kong's infamous Triad gangs, who became the only authority in the city. "No police ever came here."

The city mushroomed in the 1960s when waves of Chinese fleeing the Cultural Revolution arrived in Hong Kong. Triad developers built to the maximum height allowed near Hong Kong's airport, constructing inward and upward until the buildings met at the top.

The buying and selling of apartments and businesses were formalized through the Kaifong Association, believed to be Triad-influenced. The gangs rigged a network of hoses and lines to tap the city's water and electricity supply and then charged residents for their use. The miles of dilapidated water hoses form a leaky canopy over the district, showering passers-by.

Under the compensation plan, the government is paying the unlicensed doctors and dentists, the water and electricity suppliers -- all of the 1,000 businesses that were operating in the Walled City at the time of registration -- for loss of income.

"I don't want to move," said Wut Shui Wong, who makes amusement arcade tokens in his dank, one-room Walled City factory. "It would cost me four or five times as much to get a place outside. I couldn't make enough money to live. Besides, I know this place so well."

Amy Lam, 15, who was born in the Walled City, as were her mother, father and sister, doesn't want to move, either. "I love it here. It's my home." she said.