New York City is getting older.

The share of the city’s population that is 65 and older increased by 12.7% – or 157,000 people – between 2017 and 2022, according to a new report by the state comptroller’s office. During that same period, the share of the population that is under 18 years old decreased by 6.2% – or 112,000 people.

There were 8.3 million people living in the city in 2022 – a 1.2% drop from 2017, according to the report.

The comptroller’s report sheds new light on who stayed put and who left during the upheaval caused by the pandemic.

One factor that correlated with the exodus of people under 18: The cost of childcare.

Reports by New York State’s office of children and family services show a steady increase in costs of child care since 2017. The yearly median price of child care in New York City is $24,222. In the Bronx – or about 47% of the median household income, federal labor department data shows.

As the cost of childcare has become more burdensome, Mayor Eric Adams has backed off plans to expand free 3K for kids. The administration has redirected about $568 million originally budgeted for the program.

Many of the city’s seniors over the age of 65, who are at heightened risk of COVID, stayed put. The city Department of Aging confirmed that its own data showed an increase in older adults, and touted a number initiatives aimed at keeping them in engaged with their communities.

National studies have shown that a majority of seniors are homeowners and intend to stay in their current residence.

The state comptroller writes in the report that the city has regained its status as the economic engine for the state. But the analysis did not examine the city’s commercial real estate sector, which has not rebounded since the pandemic.