Rising interest rates and recession fears have joined to batter commercial real estate investors since the pandemic came calling, and perhaps none more than real estate investment trusts (REITs) that concentrate on office properties.

The numbers speak for themselves. For instance, the S&P 1500 Office REITs Index is down about 33% year over year. That's while the S&P 500 itself is up about 18%. The chart below shows how those two benchmarks parted ways with the arrival of COVID-19.

In the middle, meanwhile, is the CRSP US REIT Index, which shows how much the 20 or so office REITs trail even in their own sector.

^SP15ORS Chart.

^SP15ORS data by YCharts.

With a marked shift toward remote working now looking like a permanent feature of today's workplace, demand for office spaces has dwindled significantly, as has the share price of office REITs. But as with any downturn, the question arises: Is now the time to buy?

Respect the staying power of working at home

The dramatic changes in workplace dynamics are not to be underestimated. We're now beginning to see headlines about developers and owners of office space in some major markets considering handing over the keys to lenders. That symptom of this contagion is affecting other central city properties, too, of course, including business hotels, but let's keep the focus here on office space.

As more companies adopt long-term or permanent remote work policies, many office REITs are seeing growing vacancies and declining rental income, and the market is understandably nervous about the sector's future, especially those who turn to REITs for their relative stability and steady dividend income.

That said, there is an opportunity to pick up bargains in the sector by focusing on REITs that are strategically positioned to benefit from the return to the office in either hybrid form or full-time.

Two that I like right now are Highwoods Properties (HIW 0.31%) and Alexandria Real Estate Equities (ARE -0.90%). Highwoods Properties develops and owns high-end offices in what it calls the "best business districts" in such Sunbelt boom towns as Atlanta, Dallas, Nashville, Orlando, and Charlotte. For instance, featured on its home page right now is the Bank of America Tower in downtown Charlotte.

Alexandria Real Estate Equities, meanwhile, has been exclusively in the business of office and lab space for thousands of reliable tenants -- from big pharma to universities to federal research offices and more -- since the REIT went public nearly 30 years ago.

It operates what it calls "collaborative campuses" in just a few markets, such as San Francisco, Boston, Raleigh-Durham's Research Triangle, and the D.C. suburbs. These are the kind of places and spaces that attract tenants and staff who can't do their work at home and want to live in those expensive markets.

VNO Chart.

VNO data by YCharts.

The chart above shows how Alexandria and Highwoods share prices have performed in the past five years. Included for comparison are two well-known REITs -- Vornado Realty Trust and SL Green Realty -- that are prominent owners of office space in New York City. The latter have fared far worse as they cut dividends in the face of falling revenue.

A different kind of demand for office space

So for those with an appetite for risk, keep in mind there will still be a demand for office space, albeit potentially different in nature and configuration to pre-pandemic times. The key to success here will be identifying well-run REITs that are positioned to capitalize on the new paradigms of office use and ownership.

Meanwhile, you can also enjoy the passive income that comes with REIT ownership. Alexandria has raised its dividend for 13 straight years and is now yielding a respectable 4% or so at its beaten-down price; Highwoods is yielding nearly 9% while keeping its payout level unchanged since mid-2021.

These are two examples of REITs that have demonstrated resilience and adaptability to maintain their viability while positioning themselves to adapt to changing demand in their specialized markets. The bargains are there for the choosing, but do your research and go in with your eyes wide open. You'll be more likely to choose wisely as a result.