After the ill-tempered guard clanged the cell door shut, the darkness was all-enveloping. Then lights flashed on and a voice barked: "Face the wall! Hands behind your back!"

In the room, under pictures of Vladimir Lenin and Joseph Stalin, a stern-faced Soviet army officer sat hunched over a desk, smoking. "What are you doing in a restricted military zone?" he demanded.

So began an unusual Latvian exercise in retro-chic: a night in a Soviet-era slammer.

Each weekend, about 25 people pay 5 lats (about $9.40) to spend the night being bullied and interrogated in a prison haunted by Latvia's 20th-century miseries. Real and fake mix in grisly harmony: Visitors witness the reenactment of a prisoner being shot after his third escape attempt and visit the mass grave of 160 real inmates nearby.

Those inmates were shot during Germany's 1941-44 occupation of Latvia. Then came the Soviet reoccupation, which ended in 1991. Now comes the age of nostalgia as this Baltic democracy of 2.3 million people moves ever further from its painful past.

Tourists and locals can experience it in the prison at the Karosta, or "war port," in the coastal city of Liepaja. Built originally as a military hospital in 1903, the red-brick facility was converted to a prison two years later and used in that capacity until 1997.

The prison sat empty until 2002, when a group of Liepaja residents led by Liga Engelmane, a tourism agent, formed the Partnership to Save Karosta, whose well-chosen Latvian initials are KGB, and offered interactive tours.

"Inmates" can pay $3.70 for a 90-minute daytime tour, which includes being locked in a cell and a trip to the infirmary, or buy the $9.20 package, billed as an "extreme night."

Extreme nights are not for the fainthearted. The cubicles are damp, and the "extreme toilet" is four holes in the floor. Visitors do calisthenics to stay warm and sleep on planks with fleas for company. Those who disobey orders may be sent to solitary confinement. "You are exiting Hell," says an inscription above the door, written by a real-life inmate long ago.

Liepaja, like many Latvian cities, is losing many vestiges of its Soviet past as it becomes more Westernized. Sunbathers now lie on Liepaja's white sand beaches where Soviet tanks once pointed their guns in the direction of a possible Baltic Sea invasion.

Even Karosta, for five decades a restricted military zone, has an artists' commune, housed in a former military headquarters, and a gallery to display the art.

So why go through all this when you can relax on Liepaja's sandy beaches or enjoy the nearby art display?

"It allows you to return to the past and to see how it was really done," said Martins Jaungailis, 20, a college student from Riga, the capital.

Jaunus Tammeaed, 39, came from neighboring Estonia with vacationing employees of the AGA industrial gas company. He said the experience brought back memories of his Soviet army service in the 1980s.

"I don't feel threatened, so it's not so realistic in that way," Tammeaed said. "But it's a good idea for anyone who hasn't lived through those times."

Gunta Insberga, the gas company's Latvian representative who arranged the tour, explained that the group wanted to do something other than visit art exhibitions, attend concerts and sit around in bars.

"Sometimes it's more interesting in a pile of dung," she said, laughing. "We thought this would be a good way to end our trip."

"I had never slept on a wooden plank before," she added. "Everyone is going to remember this for the longest time."

Engelmane, of the Partnership to Save Karosta, said the idea was to preserve a bit of history for future generations.

"The Soviet era was painful for us," she said, "but we want to retain a part of it because there is already an entire generation in Latvia that has not grown up in the Soviet system."

She said she had heard no criticism of the tours. In fact, former prisoners have walked KGB staff around the prison, offering advice on how to make the experience more authentic.

The tour revenue pays for salaries and has provided more than $5,500 for badly needed renovations, said Engelmane. Business is good, she said; every "extreme night" this summer has been fully booked.

Visitors watch guards lead a "condemned" man to his execution in a reenactment at the former prison in Liepaja."Jailer" Vairis Zakitis points to a sign above the door of a solitary confinement area: "You are leaving Hell." The inscription was written by a real-life inmate long ago.