Investors are betting that the worst may be over for New York City landlords.

SL Green Realty Corp. and Vornado Realty Trust, two of the city’s most prominent building owners, have surged in recent days even as the city, inching toward reopening from the pandemic shutdown, grapples with unrest that’s damaged Midtown retailers.

SL Green, which is building a new tower near Grand Central Terminal, jumped as much as 8.2% to $51.23 on Wednesday, touching the highest level in more than a month. The company said earlier this week it had collected 85% of its rent for May and restarted stock buybacks.

Vornado, which is spending more than $2 billion to redevelop the area around Pennsylvania Station with new offices and retail space, also jumped on Wednesday, hitting the highest intraday level since May 1.

Manhattan faces a long recovery as companies grapple with anxiety about workers commuting on public transportation to packed office buildings, but investors are taking an optimistic approach, according to Jeffrey Langbaum, an analyst at Bloomberg Intelligence. Both stocks have been hammered this year as New York was battered by the pandemic.

“The market is buying into it because people are hesitant to bet on the alternative, which is really ugly,” he said. “For now, the market is looking past however long and deep this downturn lasts, and willing to bet on an eventual recovery.”

Vornado jumped as much as 5.8% to $41.81 on Wednesday. This would be the third straight day of gains for Vornado, which was down 41% this year through Tuesday’s close.

SL Green has also rallied each day this week so far. Its shares were down more than 40% in 2020 through Tuesday.

The S&P 500 had dropped 4.6% this year through Tuesday.

This article was provided by Bloomberg News.