SACRAMENTO, Calif. (CBS13/AP) — California saw its slowest growth rate on record for the nation’s most populous state, adding just 21,200 people during the year that ended in July, state officials said Wednesday.

For the second straight year, more people left California than moved to the state, resulting in a net migration loss of 135,600 people. People left the state in similar numbers as they did last year. but far fewer people moved to California, especially from April to June, when the state was under a stay-at-home order because of the pandemic.

READ MORE: 'A Trend That Won't Go Away': Sacramento City Leaders Consider Permanent Plans For Street Dining

California had fewer births this year. But after subtracting deaths, California still added 156,600 people to its population.

Overall, the state’s population grew 0.05%, down from 0.23% the prior year. Its total population now stands at 39.78 million people.

The latest estimate came from the California Department of Finance and covers the population change from July 1, 2019, to July 1, 2020.

Recent high-profile departures include Tesla CEO Elon Musk, who moved to Texas, where tech giants Hewlett Packard and Oracle also intend to move their headquarters.

Matt Frinzi, 68, moved from San Francisco to Reno, Nevada, on Tuesday. He had lived in California for 25 years but said he was tired of paying high income taxes and frustrated with the deterioration of his neighborhood. Nevada doesn’t have a state income tax.

READ MORE: Sacramento Kings Tickets Back On Sale, But COVID-19 Guidelines Will Discourage Booing Or Yelling

More from CBS Sacramento:

“I loved San Francisco when I moved here in 1996. I thought it was the premiere city in the United States. I wouldn’t give you a nickel for it now,” he said. “I think there is a quiet rebellion growing.”

While many people are moving out of the state, Sacramento is seeing a housing boom. The real estate company Realtor.com is ranking Sacramento as the hottest real estate market in the country heading into next year. The report shows the pandemic is helping put Sacramento on the home buying map.

Sacramento is the top city in the country for combined housing sales and price growth, showing a combined 24.6 percent increase. Cities rounding out the top five were San Jose, Charlotte, Boise, and Seattle.

The report increased freedom to work remotely as the top reason buyers from the Bay Area are flocking to Sacramento.

MORE NEWS: Placer County Deputy Investigating Mail Theft Finds Out He Himself Was A Victim

(Copyright 2020 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)