A dramatic court decision saved dozens of Washington Heights tenants from eviction last week. But their lawyers say the landlord’s move was just the latest in a slew of brazen new attempts to rid the neighborhood’s increasingly valuable real estate of its rent-stabilized residents.

Schuyler Carroll, the owner’s lawyer, thought he had it all figured out. In a 2003 New York Law Journal article, he argues that bankruptcy can be used to “evict undesirable tenants.” He put that theory to the test in December by slipping an eviction clause into an otherwise ordinary bankruptcy order, which governed the sale of 516 West 174th Street. Judge Prudence Carter Beatty approved it without hesitation.

But at an emergency hearing last week, she was livid. “You pulled a big fast one on me!” she barked when Carroll stepped up to speak. “I would not have signed that order.” She only learned of the eviction, she said, when the U.S. Marshal charged with enforcing it called to make sure she knew what she’d agreed to.

“This is just beyond appalling,” she said. “I cannot think of a worse thing that I have seen somebody do in the time I have been on the bench.” She vacated the order and left the lawyers to work out the details.

The tenants, who filled two rows in the back of the courtroom, were visibly relieved. They had received letters delivered by hand on January 25, telling them they had 12 days to move out or face forcible eviction.

“We were terrified,” said Lee Almanzer, 28, a Parks engineer who lives in the 21-unit building with her father. Many of the tenants are low-income, immigrant families with young children. Some are elderly or disabled. “What do you with those people?” she asked.

Fourteen-year-old Francia Perez, who lives with her mother and two siblings, said she was pleased with the ruling, but still worried. “I just hope it doesn’t happen again,” she said.

The lawyers who helped defend the tenants are worried, too. As the housing market in Washington Heights and Inwood soars, landlords and their lawyers are finding ever more inventive ways to cash in, explained Kenneth Rosenfeld, an attorney with the Northern Manhattan Improvement Corporation. His office has seen a surge in landlords trying to evict tenants for minor lease violations or to opt out of subsidy programs like Section 8.

“It’s similar to the stock market in the late 90s,” he said. “People figure, ‘Let’s just take a shot.’ It’s so worth it if they hit gold and vacate the building that anyone’s willing to take any chance that they can.”

Northern Manhattan is especially hot these days, agreed Gus Perry, of Stein-Perry Real Estate, which specializes in high-end rentals and sales in the area. Musicians, actors, students and other bohemian types who can’t afford Chelsea or the Village are discovering the charms of “NoMa,” he said.

While most of the apartments are rent-stabilized, a landlord looking to invest can still turn a profit—if just one or two long-term tenants move out. “Prices have probably doubled in the past three to five years,” said Perry. “A lot of people are buying for speculation.”