The lobby of the Manhattan building once known as the Royal Park Hotel still beckons to tourists: A sign advertises cheap shuttle rides to nearby airports, and rows of pamphlets promoting Broadway musicals and attractions like the Guggenheim Museum.

But nobody has checked in since the pandemic swept into New York and crushed its tourism industry. Instead, the seven-story building on the Upper West Side is being converted into permanent housing for homeless people — part of an urgent push to alleviate the city’s severe housing crisis.

The story of the Royal Park is, in part, a story of how what was once a tenement came to be a flash point in the city’s long-running fight against building owners who illegally rent out rooms to tourists instead of long-term residents.

But it also underscores a significant way that the pandemic could remake the city by turning struggling hotels and vacant office buildings into housing.

The need is acute. Between 2000 and 2017, New York City added 643,000 new jobs, but only permitted roughly 390,000 new housing units, according to city figures, helping to drive up housing costs and tip more people into homelessness.

Efforts to come up with new ways to increase the housing supply are taking place elsewhere. California, which faces its own housing and homelessness crisis, has moved to convert dozens of hotels into thousands of homes. Similar Efforts in New York have laggedhowever, largely because land use rules and other restrictions make buying and converting hotels complex and expensive.

gov. Kathy Hochul has proposed easing some rules, and Mayor Eric Adams has also called for revamping city building codes to speed conversion projects that he said could provide tens of thousands of new units.

But if tourism rebounds, those efforts could be stifled.

“Right now, we are presented with a time-limited opportunity that we would not pass up,” said Brenda Rosen, the president and chief executive of Breaking Ground, a nonprofit focused on housing.

Between 1990 and 2004, the group converted three hotels near Times Square into housing, mostly for formerly homeless individuals; Bureaucratic hurdles and expense kept the number low, Ms. Rosen said. In 2018, the group bought a fourth hotel near Downtown Brooklyn, expected to open this spring.

The transformation of the Royal Park also reflects a feud between the city and operators of illegal hotels, who officials say have made a chronic housing shortage worse by limiting rentals to short-term guests in violation of city and state laws.

City officials waged legal battles for years with Hank Freid, a hotelier who owned the Royal Park on West 97th Street, arguing that several of his hotels and hostels were intended to be permanent housing.

Earlier this year, the Fortune Society bought the building for $11 million. The nonprofit focuses on helping formerly incarcerated people, who will make up many of the building’s new tenants.

“It was an opportunity to purchase a property that we would never be able to afford,” said JoAnne Page, the president and chief executive of the Fortune Society.

Mr. Freid has not publicly said why he sold the building. He did not respond to requests for comment, and his lawyer, Ronald J. Rosenberg, declined to comment through a spokesman.

Conversions can be easier when buildings were already designated for permanent housing, as the Royal Park was. At the Royal Park and at least one other illegal hotel, another seven-story building on the Upper West Side that is being converted into housing for low-income older adults, many of the bureaucratic roadblocks were eliminated.

A spokesman for the city’s Buildings Department said records from the 1910s, among the earliest that were immediately available, indicate that the Royal Park was originally a tenement. It was later converted into more than 100 single-room occupancy, or SRO units, which typically have shared bathrooms or kitchens.

SRO’s were once a huge part of New York City’s affordable housing stock, but many were eliminated between the 1950s and the 1980s, as city officials and the public increasingly associated them with poverty and crime.

Many were torn down and replaced with luxury homes, particularly in affluent neighborhoods like the Upper West Side.

Mr. Freid, who owns other hotels in New York City and Florida and runs a yacht chartering business, purchased the building in 2004, according to city records, and marketed it as a cheap hotel for visitors. A listing for the hotel on the TripAdvisor website promotes the Royal Park as being close to shops and bars and a short train ride to Midtown and downtown.

In 2017, the city filed a lawsuit, accusing Mr. Freid of operating the hotel illegally when it was supposed to be permanent housing. The lawsuit also cited several violations, including a lack of proper lighting around exits, obstructed fire escapes and too few emergency exits.

Mr. Freid argued in legal filings that many of the violations had been dismissed or resolved, and that the building’s classification did not prevent him from running it as a hotel.

But he eventually decided to sell the building to the Fortune Society.

After the sale was finalized, the city settled its lawsuit, and Mr. Freid agreed to pay roughly $1.1 million in penalties, though he admitted no wrongdoing.

Ms. Page said the building will open to new residents next year. Of the 82 units, 58 are slated to be filled by people living in homeless shelters, and another nine apartments will be filled through the city’s affordable housing lottery.

The remainder of the units are reserved for a small number of tenants who have been living in the building for years, and in some cases, for decades.

The building, according to the Fortune Society, will provide on-site support services, like case managers to help people with nutrition, employment and substance abuse.

The total cost, including the rehabilitation and operation, is roughly $31 million, which Ms. Page said the nonprofit was working to raise. The city was also expected to contribute.

Mr. Adams said the conversion was the kind of innovative strategy his administration would pursue to tackle the need for housing.

“We need a response with the urgency to match the crisis, and we will explore every opportunity, in every corner of the city, to create the affordable housing New Yorkers need and deserve,” he said in a statement.

Housing advocates and some Upper West Side residents said the deal was needed in a neighborhood that has grown wealthier and increasingly white.

But some residents have expressed concern about the plans for the building and its future tenants, echoing the tensions that erupted in the neighborhood in 2020 when homeless men were temporarily moved into the Lucerne Hotel, about a mile to the south.

During public comment at a community board meeting in February, a woman who said she owned a neighborhood business and was identified only as Kim said she and other small business owners were “upset and anxious about what’s coming.” She noted that they were already grappling with problems like loitering, panhandling and shoplifting, according to a video of the meeting.

The chairman of the community board that covers most of the Upper West Side, Steven Brown, said he was impressed with the Fortune Society’s willingness to engage with residents, but added that the board only learned of the project in mid-February, when the Adams administration issued a news release.

“I do think that the community board would have liked to have been involved along the way,” he said. “I’m not saying that would have changed anything.”

Arturo Coto, 70, has lived in the building since 1988, three years after he immigrated to New York from Honduras. Before the pandemic, he said he enjoyed meeting hotel guests from around the world.

He was not worried about the new tenants as long as he continued to have an affordable place to live, even if he would have to still share a bathroom in the hallway and live without a sink or stove.

The monthly rent is about $346, and he lives largely on what he receives from Social Security. (Ms. Page said units like Mr. Coto’s are rent-regulated and the rent will remain the same.)

“There aren’t enough homes for people living on the streets,” Mr. Coto said. “I want those people to have homes but also let us live here.”

Ana Ley contributed reporting, and Susan C. Beachy contributed research.