The biggest U.S. companies are sitting on record piles of cash. They are getting paid next to nothing for holding it, and they are running out of ways to spend it.

So they are buying a lot of commercial real estate.

Google’s announcement last week that it would purchase a Manhattan office building for $2.1 billion is the latest in a string of blockbuster corporate real-estate deals since the start of the pandemic. Amazon.com Inc. last year paid $978 million for the former Lord & Taylor department store in Manhattan. Facebook Inc. bought an office campus in Bellevue, Wash., for $368 million.

Overall, publicly traded U.S. companies own land and buildings valued at $1.64 trillion, according to S&P Global Market Intelligence. That is up 38% from 10 years ago, and the highest for at least the past 10 years, according to S&P.

Retailers such as Walmart Inc. and restaurant chains such as McDonald’s Corp. have long been major property owners of their own stores. Big technology companies are now joining them, scooping up offices, data centers, warehouses and even retail space.

Buying real estate is a way for these companies to avoid sometimes pricey and cumbersome leases, because they often occupy these buildings and become their own landlords. These usually modern or renovated and sometimes custom-built properties are the kind of buildings that have appreciated in value over the years. But owning real estate also puts companies at risk of losses if urban property values fall.

For now, the corporate buying spree is helping prop up commercial real-estate markets at the same time many investors are shying away from office and retail buildings amid rising vacancy rates.

Many private-equity and real-estate funds have also raised hoards of cash, but for the most part they have been reluctant to spend during the pandemic in hopes that prices could fall further. And unlike real-estate investment firms, big corporations often buy their buildings without taking out mortgages, allowing them to spend more of their money and to close on deals more quickly.

A number of factors have converged to unleash the buying spree. For one, firms have more money to purchase real estate. Big, profitable companies that dominate their industries have grown even bigger, allowing them to accumulate more cash. More recently, uncertainty over how much Covid-19 will harm the economy has prompted more companies to hoard cash, said Kristine Hankins, a professor of finance at the University of Kentucky.

U.S. publicly traded companies hold $2.7 trillion in cash, cash equivalents and short-term investments, not counting real-estate and financial companies, according to S&P Global. That is up more than 90% from the fourth quarter of 2011.

Interest rates are hovering around their all-time lows, so companies can get higher returns buying real estate than by keeping their money in low-risk bonds or other public securities, said Brian Kingston, chief executive of real estate at Brookfield Asset Management.

“That cash is just sitting there in a not particularly productive way,” he said.

Office prices, meanwhile, have fallen in Manhattan, San Francisco, Chicago and other big cities during the pandemic, making investing in this real estate cheaper than it was 18 months ago, investors say.

Google and its deep cash coffers have set it apart from most every other company in terms of an increasing appetite for real estate. Alphabet Inc., Google’s parent, held $135.9 billion in cash, cash equivalents and short-term investments as of the second quarter of 2021, more than any other publicly traded company, not counting financial and real-estate firms, according to S&P Global.

Alphabet is now one of the biggest real-estate owners in New York City and the U.S. It held $49.7 billion worth of land and buildings as of 2020, up from $5.2 billion in 2011.

SHARE YOUR THOUGHTS

Have you encountered corporate investors in the real-estate market? What was your experience? Join the conversation below.

Google buys real estate because it wants to control the buildings it occupies, for example to make changes without having to get a landlord’s permission, said the company’s director of public policy and government affairs, William Floyd.

Amazon, which owns a lot of warehouses, held $57.3 billion worth of land and buildings—more than any other U.S. public company except Walmart. The online retailer doesn’t care whether it buys or leases as long as the building is right, according to the company’s vice president of real estate and global facilities, John Schoettler.

“We’re really agnostic about it,” he told The Wall Street Journal last fall.

Write to Konrad Putzier at konrad.putzier@wsj.com

Copyright ©2021 Dow Jones & Company, Inc. All Rights Reserved. 87990cbe856818d5eddac44c7b1cdeb8