SACRAMENTO (AP/CBS13) – California’s population shrank for the second year in a row in 2021 as the nation’s most populous state was hit by declining birth rates, higher deaths from the pandemic and fewer people moving into the state from elsewhere in the U.S., officials said Monday.

California lost 117,552 people in 2021, putting its population to 39,185,605, the California Department of Finance said. That’s still the largest state population in the country ahead of second-place Texas.

READ MORE: Texas School Shooting: What We Know About The Mass Shooting That Left 21 Dead

But after years of steady population growth for California that put it close to having 40 million residents, the state’s population is back to where it was in 2016.

State officials blamed the loss on a declining birth rate for California coupled with an increase in deaths, mostly because of COVID-19.

READ MORE: Gun Found In Desk Of Second Grader At South Sacramento School, District Says

Also, fewer people are moving to California from other states and state officials have said that federal immigration policies have drastically curtailed the number of people moving to the state from other countries.

California’s population declined for the first time in 2020, the result of a multi-year slow-down in growth that led to the state losing a seat in Congress after the 2020 U.S. Census.

Thirty-four of the state’s 58 counties lost people last year. They included Los Angeles County – the nation’s most populous, with 9.8 million residents – and San Diego and Orange counties. They are three of the most populous counties in the country.

MORE NEWS: Call Kurtis Investigates Whether You’re Getting What You Paid For At The Pump

Copyright 2022 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.