Despite the turmoil that has racked Manhattan’s largest apartment complex over the past eight years, Stuyvesant Town-Peter Cooper Village is still an object of desire for speculators, investors and the tenants who make it their home.

CW Capital, which has controlled the complex on behalf of lenders since 2010, is now furiously trying to fend off a mysterious investor from seizing the property and thwarting the company’s plans to sell it to the highest bidder, for as much as $5 billion.

The complex, with 11,231 apartments sprawled across 80 acres between 14th and 23rd Streets, east of First Avenue, had for decades been a rare affordable refuge in Manhattan for middle-class families.

But during the last real estate boom, the complex’s 110 plain, brick buildings, on a wide, leafy swath of Manhattan, attracted the attention of investors and speculators around the globe.

Stuyvesant Town-Peter Cooper Village soon became a cause célèbre for its 20,000 residents, elected officials and housing activists who denounced the continuing loss of housing affordable to poor, working-class and now middle-class residents.

The property sold in 2006 for a record $5.4 billion to Tishman Speyer Properties and Black Rock, who used mostly debt and money from pension funds and other investors. In 2010, the new owners defaulted on their loans. CW Capital took over on behalf of trusts that have a $3 billion mortgage on the property.

Several prospective bidders contacted Singapore’s sovereign investment fund, which had provided Tishman Speyer with a $575 million loan for the Stuyvesant Town deal and invested $189.4 million. It now appears that the Singapore fund has sold its loan to another party, according to several real estate executives.

Image

During the last real estate boom, the complex’s 110 plain, brick buildings, on a wide, leafy swath of Manhattan, attracted the attention of investors and speculators from around the globe.CreditChang W. Lee/The New York Times

Last week, an unidentified company notified CW Capital through its lawyers that it was exercising its right to buy a key loan on the property. CW Capital assumed it was the first step in trying to seize control of the complex and force it into bankruptcy, in which the new owner would try to buy it for a low price.

In response, CW Capital went to court Thursday morning to formally take ownership of the property. It paid $117 million in taxes to the city and $19.8 million to the state.

“In light of circumstances, we have decided to cancel the auction and take the property back via deed in lieu of foreclosure,” said Andrew MacArthur, a managing director of CW Capital.

Real estate executives say that the mysterious company will probably respond with a lawsuit.

The fate of Stuyvesant Town-Peter Cooper Village presents a serious challenge for Mayor Bill de Blasio, who has made affordable housing a centerpiece of his administration. The loss of more than 11,000 apartments to a buyer seeking to convert the complex into a luxury enclave would be a setback.

Deputy Mayor Alicia Glen has been meeting quietly with CW Capital, tenants and prospective bidders to both understand what is a complex transaction and figure out the city’s options in preserving some affordable housing at the complex.

Wiley Norvel, a spokesman for Ms. Glen, said Thursday that the administration welcomed the latest developments, which “gives more breathing room for us to work with the lender and the tenants on a solution that protects affordability at Stuy Town. The city is committed to using every tool at its disposal to accomplish that goal.”

Daniel Garodnick, a city councilman who lives in Peter Cooper Village and has worked closely with the tenants’ union, was upbeat. “It is the next right step that will give time for a more considered process that can protect not only the bondholders, but also the tenants and the city,” he said.

The prospect of a sale had already drawn interest from real estate companies and hedge funds, including Blackstone, Related Companies, Extell Development, Centerbridge Partners and the LeFrak real estate family.

CW Capital may also be concerned about the prospects of its parent company, Fortress Investment, in the event of a sale. Fortress is reportedly assembling a $4.7 billion bid for the property. It already has an advantage over rival bidders because CW Capital, as the special servicer for the property, is entitled to $424.6 million in interest related to the mortgage default.

A version of this article appears in print on , on Page A20 of the New York edition with the headline: At Stuyvesant Town, Fending Off a Seizure. Order Reprints | Today’s Paper | Subscribe

Sign up for the New York Today Newsletter

Each morning, get the latest on New York businesses, arts, sports, dining, style and more.