COPENHAGEN, Denmark

The whole thing started with a hole in a fence around an abandoned military barracks in central Copenhagen.

Parents in the neighborhood tugged at the hole to widen it. Soon it was big enough for their little kids to scramble through to play in the grassy open spaces within.

Not long after, squatters cut a large patch out of the fence and commandeered the whole barracks for their own use. They named the area “Christiania,” stuck out a flag, and declared themselves free from the rule of Danish law. Nearly four decades later, the flag is still flying.

This derelict army depot’s run as a makeshift playground was short. But it has had a long and often troubled run as a refuge for Copenhagen’s fringe society. And now the Danish government, which has been listing right in recent years, has given up on clemency for the collective. It appears determined to finally dissolve the self-governing community of nearly 1,000 in what it calls “normalization.”

But Christiania took a preemptive strike late last year and filed a couple of lawsuits, which are now being heard by Denmark’s Eastern High Court. Decisions are expected at the end of this month.

The first suit cites as precedent a 1973 agreement that briefly allowed the commune to exist as a “social experiment.” The second is, in essence, a class-action suit filed by the residents, claiming a right to live on the site without eviction, because they have now possessed it into the third generation.

In October, police evicted residents from a house on the rim of the commune, setting off a six-hour showdown.

Christianites lobbed beer bottles and Molotov cocktails at police, and were answered with sprays of tear gas. Danes caution that if the court rules against Christiania in either case, more widespread rioting is a given.

The situation is more farce than tragedy, but Denmark is once again the stage for a pondering first posed 400 years ago by Hamlet: To be or not to be.

• • •

For Danes, the question is a fiery one, igniting on one side deeply held principles about freedom, nonconformity, and tolerance. A great number of Danes look to Christiania as the alter ego of the nation, and its right to exist is robustly defended. “In Denmark, everything is occupied and controlled. There’s not much space left in the cities, but Christiania is a kind of asylum. People feel more freer there than in the rest of the society,” says Rene Elley Karpantschof, a sociologist at the University of Copenhagen. But those opposed are fed up with the deeply rooted drug use, the land occupation, and the snubbing of laws. “It has been made a haven for criminals from neighboring countries, like Sweden or Norway,” says Jesper Nielsen, a cultural historian at Denmark’s National Museum. “So you could say they accept a criminal form of control within Christiania, but they resist control from without.”

Christiania, which takes its name from the Christhavn district in which it sits, began as a protest against the lack of affordable housing. The far left grandly championed the squatters. “Christiania is the land of settlers. It is so far the biggest opportunity to build up a society from scratch,” wrote well-known counterculture activist and journalist Jacob Ludvigsen as the squatters set up. Dilapidated army barracks were transformed into houses, and warehouses were outfitted with printing presses. Kindergartens were created, more houses built, stores and clinics opened, and a local post office was opened. No one paid utilities, rent, or taxes. Money was doled out equally, and smoking hash was as common as blinking. The “Freetown of Christiania” designed its own postage stamp, its own constitution, and its own flag. It had its own currency. It was known for its freewheeling lifestyle and funky, brightly painted houses.

Eventually, Christiania agreed to pay for utilities and a nominal tax per house. But the area, centrally located and with a pristine waterfront, has long been eyed by developers.

“When I first came here, I was Red. I was for a revolution,” says Hjordis Oppedal, an artist who moved to Christiania in 1976 and maintains a studio there. “At first I didn’t like the drug users here, the addicts. But I realized all people have rights and I learned to keep an open mind.” Yet the hard drug use spiraled out of control, and an underworld of dealers swooped in to tap the growing market. What began as an anticapitalist utopia became a battleground of drug lords fighting for real estate. Police began regular raids on the drug-laden kiosks along Pusher Street, the commune’s main street.

Concerned that history was about to be swept away, the National Museum snatched up one of the infamous kiosks and put it on permanent display. Residents say the days of hard drugs are over, but they keep a lid on exposure and strictly forbid photos and videos. As one young Christianite mother, holding the hand of her blond toddler, explained recently, “There are drugs here, and we don’t want the police coming around.” The stalls remain, but police still sweep through. “Many people are ready to fight for Christiania,” says Dr. Karpantschof. “If the state wants to continue to try to destroy it bit by bit, there will be a whole lot of unrest.”

But the flag of tolerance doesn’t wave freely. Living space is at a premium inside the commune, so it is officially closed to new residents. Tolerance is relative and random within the Freetown of Christiania. Musician and artist Denis Agerblad was invited to take over the downstairs of a house for use as a studio. But soon he found he had to contend with three teenage squatters.

“It just happened one day that we had people pushing on the other side of the door, trying to get in,” says Mr. Agerblad. “They were actually drilling and eventually got in. As far as I know, they’re still living there.” Parents in Christiana “will do anything” to get living space there for their grown children, he adds.

• • •

Christiania was born under a hopeful light at a time when Denmark was darkened by social problems. The commune held out the ideal that there was the possibility of another possibility. But its revolution is complete. Today’s Denmark is among the wealthiest, safest, most liberal, most socially articulate of nations. Two recent surveys have ranked Danes as the happiest people in the world (one by Stockholm-based World Values Survey, another by University of Leicester in England). The nation’s evolution leaves the Freetown of Christiania chained to the past. A museum piece.