Danish politicians have agreed a law that paves the way for a new legal basis for Christiania, the enclave famous for its alternative lifestyle.
Christiania was a 'no-go' zone for police until a few months ago
The enclave's future has been in doubt since the government said it wanted to "normalise" the counter-cultural zone.
Since 1971, Copenhagen has tolerated the existence of Christiania in its midst, a home to hippies and leftists in pursuit of an alternative lifestyle.
However, its illicit drug economy has attracted censure from the authorities.
Having for years remained a no-go area for the police, a spectacular raid earlier this year ended its reputation as a drug haven.
Several suspects were apprehended and, say police, Christiania's booming cannabis economy, said to be worth some $80 million annually, was shattered.
But government plans for the commune were initially opposed by left-wing parliamentarians, activists and artists.
The new law, agreed on Tuesday, leaves open the possibility for an independent committee to take charge of Christiania, a plan favoured by many residents.
A police spokesman said the illegal drug market that had flourished in Christiania would not be allowed to develop again.
Under the new law, several houses built on the site of an old naval fort will be torn down, while an extra 300 houses will be built elsewhere on the site.
The 1,000 residents will also have to pay a fixed rate for utilities such as gas and electricity, much of which they have been using for free.
Christiania is one of Copenhagen's biggest tourist attractions.