The Empire State’s population has fallen for the first time in a decade — dropping from 19,795,791 in 2015 to 19,745,289 in 2016 — because of an exodus of people from New York’s northern and western rural regions, according to US Census estimates.

The state slump comes even though the population of the New York City metro area is booming — with the five boroughs, Long Island and the Lower Hudson Valley gaining 21,540 people between 2015 and 2016, while upstate lost 23,434 during the same period.

The increase was highest in The Bronx, where a 5.1 percent rise brought the borough’s population to 1,455,720, according to Census data showing changes in population by county from 2010 to 2016.

“Our borough has seen an incredible resurgence over the past decade, including considerable new housing development that has driven that growth,” said Bronx Borough President Ruben Diaz Jr.

Brooklyn came in a close second, with a 4.97 percent increase in population between 2015 and 2016, to a total of 2,629,150 residents.

The population in Queens is up 4.6 percent, to 2,333,054 people.

There are 3.65 percent more Manhattanites, for a total of 1,643,734.

Staten Island went up by 1.55 percent, to 476,015.

The city’s overall population was 8,537,673, as of July 1, 2016, the data show.

Outside the city, Rockland, Saratoga and Tompkins counties saw the largest population increases.

The biggest loser was tiny Hamilton County in the middle of the state, which shed 6.22 percent of its 4,836 residents.

The population in the Buffalo, Cheektowaga and Niagara Falls region plummeted by 2,675; in the Rochester region by 2,401; and in the Binghamton region by 1,785, records show.