The rise of homelessness has been a hot topic of late, and deservedly so. Unfortunately, some are trying to rewrite the history regarding how and why the population in homeless shelters has risen.

So here’s the real story.

Starting in 2002, the Bloomberg administration embarked on aggressive, innovative efforts to better care for those less fortunate, starting with completely overhauling a decades-broken homeless-intake system that inhumanely bused the homeless around all through the night, substantially improving conditions in shelters (something even our fiercest opponents admit) and starting the first-ever Street Count to determine the number of people sleeping on the street, who they were and how we could help them.

And we oversaw a nearly 30 percent decline in the number of homeless on the street.

Another step was the creation of the Work Advantage program in 2007, which successfully moved tens of thousands of families out of shelters and into permanent housing by providing housing subsidies.

The program was critical in helping to stabilize the number of families in shelters, which had been growing since the great recession began. Despite the brutal economic climate caused by the financial collapse, the sheltered population in the city remained stable — between 36,000 and 39,000 — from January 2009 to March 2011 due to the Advantage program.

In February 2011, Gov. Andrew Cuomo issued his proposed budget, which included ending Albany’s share of funding for the Advantage program. Doing so would trigger an end to the federal matching funds we received for the program.

In the following months, Mayor Michael Bloomberg and his administration pleaded for the funding to be restored. They noted if the state cut its share of funding, the city would be forced to shutter the program, as the city could not replace the lost state and federal dollars and warned that killing the Advantage program would result in a sharp increase in the number of homeless in the city.

Unfortunately, the Coalition for the Homeless actually advocated for the state to cut the program.

Equally unfortunate, there was no outcry whatsoever from the city’s political class, advocates or care providers about the state’s proposed cut, leaving the Bloomberg administration as the only voice trying to save it — a fight we eventually lost, in no small part due to a lack of support from others in town.

The city’s other elected officials essentially stood idly by as the state moved to eliminate funding for a successful social services program — an occurrence that typically would cause outrage from Democratic politicians and interest groups.

The final state budget passed March 31 of that year, and the funding for the program was eliminated, over the vociferous protests of the Bloomberg administration.

With state and federal funding now eliminated, the city was forced to begin the process of shutting down the program it created, supported and successfully implemented. A halt on new leases began in April 2011, and over the course of the next year, existing leases stopped receiving the subsidy.

Then, precisely as we predicted, the number of people in homeless shelters started to rise sharply, going from 38,800 in May 2011 to more than 60,000 at the peak earlier this year.

During the 2011 budget debate, the Coalition for the Homeless dismissed the Bloomberg administration’s predictions about what would happen if the Advantage program was cut by the state. They claimed our dire warnings constituted nothing more than “scare tactics.”

The results speak for themselves. Our predictions weren’t negotiating tactics, but the harsh reality of what would occur if the state cut the program.

Later, in an extraordinary display of hypocrisy, the Coalition for the Homeless supported a lawsuit when the Bloomberg administration began to stop sending Advantage subsidy checks. They supported a lawsuit to keep the program in place — the very same program they advocated to end.

As we watch this debate play out, it’s important to remember the history, accurately, about how the city’s shelter population swelled, and where leaders and interest groups stood at the critical moment on the issue.

Robert Doar was the commissioner of the New York City Human Resources Administration from 2007 to 2013.