AUSTIN, TEXAS – In March 2020, the outlook in Austin was bleak after the pandemic forced business closures, lockdown orders and the cancellation of South by Southwest, the annual festival that brings in millions of dollars for the city.

A year later, optimism has replaced despair. Across the nation, the coronavirus remains a threat and empty office buildings and restaurants have hampered growth, but Austin, the Texas capital, has emerged as a hot spot for commercial real estate investment and a magnet for out-of-state corporate relocations that are strengthening its allure as a center of high-tech industry.

"It's the hottest market in the country right now," said Mike McDonald, vice chairman at Cushman & Wakefield who represents pension funds, insurance companies and real estate investment trusts. "Millennials are moving to the Sun Belt, and companies are following the millennials. Investors are following the companies."

The city has become the No. 1 destination in the United States for potential commercial real estate investment, according to the CBRE Group, a national real estate services and investment firm. It displaced Greater Los Angeles as the most preferred market for 2021 because of the resilience in its labor market and an outlook for steady growth, according to an investor survey that CBRE will release this week.

The economic impact of the pandemic resulted in a net loss of 33,400 jobs in the Austin metropolitan area in 2020, according to the Austin Chamber of Commerce, but the influx of new companies helped Austin sustain the blow better than most other cities. A record 22,114 new jobs were attributed to businesses either expanding in Austin or moving to the city in 2020, compared with 13,562 in 2019, the chamber said.

The city's prosperity is part of a broad economic wave that has spread across parts of the Sun Belt. The Dallas-Fort Worth area, which ranked No. 2 on CBRE's investment survey, has also been high on the list of urban centers that have seen stability during the pandemic.

"The Sun Belt markets of Austin, Dallas, Phoenix and Atlanta were among the top-performing metros where the least number of jobs were lost in 2020," CBRE said in its survey.

Home to offices of tech giants such as Apple, Dell, Facebook, IBM and Samsung, Austin is increasingly considered one of the nation's dominant tech hubs after Silicon Valley, promoting itself as "Silicon Hills," a reference to its location in the Texas Hill Country.

That cachet has helped lure others. Elon Musk, chief executive of Tesla, said in December that he had moved to Texas from California, an announcement made as construction crews were erecting a $1.1 billion, 5,000-employee Tesla factory in the East Austin area. Oracle, one of the world's largest database companies, announced in December that it was moving its headquarters to Austin from Silicon Valley.

"It's become the second home for a large cluster of the larger tech companies," said Charlie W. Malet, president and chief investment officer of San Francisco-based Shorenstein Properties, which invests in 22 markets across the country, including Austin. "

Nationwide, office vacancy rates rose to 17.1% by the end of 2020, the third consecutive quarterly increase, according to a report released in January by JLL, a commercial real estate services company. But the market in Austin was strong, "with less than 1% net occupancy losses in 2020," the report said. Experts attribute Austin's counterintuitive economic performance to a number of factors: a stature as an education center and tech hub, a business friendly climate, an abundance of social attractions and the charming eccentricity that spawned the slogan "Keep Austin Weird."

The flood of job-seekers coming to Texas has led to an influx of out-of-state investment capital, said William C. Jenkins, a principal of Stonelake Capital Partners, a developer in Austin that is planning a 50-story office and residential tower downtown.