Alex Ricardo, 39, hadn't thought of haunted houses since he was a boy, but that changed two years ago, when he found what otherwise seemed to be an ideal apartment on Roosevelt Island, off Manhattan's Upper East Side.

"The building is in the footprint of where part of a . . . psychiatric hospital used to be," he said, "and a lot of my neighbors have claimed to have heard weird noises throughout the building."

A seemingly insatiable lust for prime real estate in cities has led developers to the novel idea of turning dilapidated structures with dubious pasts into what may be a new trend in urban living: asylum chic.

Once home to diseases like typhus and cholera and methods of mental-health care now seen as barbaric, former psychiatric hospitals on or near prime residential centers are being gentrified as modern apartments with parks, shops, even day-care centers for children. Yet their past has not escaped them.

Costa Pacific Homes of Wilsonville, Ore., hired a psychic a few years ago to survey the former Dammasch State Hospital, whose sister facility, Oregon State Hospital, was the setting for the film One Flew Over the Cuckoo's Nest.

The Dammasch facility, which opened in 1961 and closed in 1995, was the site of experimental approaches to mental-health treatment, including electroshock therapy, drug intervention and seclusion.

Nicholas Brooks of Portland, who is looking at properties there, said he believes in paranormal activity but the rumors of ghosts have a real downside.

"I didn't want people to be afraid to come and visit me because of the rumors of haunted people roaming the grounds," he said. "I think having a psychic come here was cool, but when it gets dark and you walk around, hearing any noise might freak you out."

In Danvers, Mass., the former Danvers State Hospital, which closed in 1992 but gained notoriety as the set for the 2001 horror film Session Nine, has more recently been converted into apartments and condos.

Paul Smith, who grew up in Danvers, said he knew a family whose son got a broken arm while residing there.

"My parents told me that some townspeople who worked there knew of abuse at Danvers from the orderlies there," he said. "A few adults used to joke that if children were misbehaving, they would be sent to Danvers to get disciplined, but it seemed more serious to me."

Last year, a fire destroyed some of the buildings under construction at the Danvers apartments. Smith said some people thought the fire was retaliation from the spirits against building.

"I don't think they ever determined the cause of the fire, so that made some people think about ghosts," he said. "Right after the building opened, there was also a blackout one night, and a few people moved out because they just got bad feelings about the place."

In New York, the Octagon Tower was built in 1841 and used to house part of a mental asylum and large hospital complex. It featured a massive "flying staircase" and intricate stonework, but the facility closed in 1955. Then, during the last half-century, the vacant building fell into a haunting state of disrepair.

Bruce Becker, the architect who led the restoration of the Octagon, said such projects take a lot of time to restore but create truly innovative communities steeped in the history of their former grandeur.

"The grand six-level flying staircase that Charles Dickens once wrote about as being 'spacious and elegant' was rebuilt and reinterpreted based on a new David Rockwell design," Becker said.

Dickens also described the facility, then known as the Blackwell Island's Penitentiary, as overcrowded and disease-filled.

In an 1842 edition of American Notes, his personal travelogue, he described the Octagon complex as having a "lounging, listless, madhouse air."

Judith Berdy, president of the Roosevelt Island Historical Society, said that while the Octagon has a long reputation as a mystic place, it's steeped in history.

"Sure, some people think there are ghosts here, but there are still ruins of the old smallpox hospital on the island," she said. "When I moved here in 1977, the Octagon Tower was still dilapidated and was truly falling apart."

Ricardo said that there isn't anything scary about his apartment, but along with other residents, he has heard some strange noises.

"I have heard the pinging sound of a metallic bowl from the ceiling, and no one can explain where it is coming from," he said. "There should be a logical explanation to the noise, but it keeps on coming and going, so some people think former residents might be spooking them."