If you listen long enough to Bill de Blasio’s conservative critics, you might almost believe that New York’s mayor has singlehandedly created the epidemic of modern urban homelessness, all but luring men and women onto the streets himself.

“DeBlasio’s progressivism created city’s homeless crisis,” blared the headline of a cover essay penned for the New York Post by former mayor Rudolph Giuliani this past September. “A city with homeless on its streets is a city that has no love of its people,” Giuliani began—before going on, with his usual up-is-down logic, to accuse de Blasio of abandoning the “love and compassion” that, he claims, he showed homeless people in the 1990s. New Yorkers with unimpaired memories remember Giuliani’s treatment of homeless people rather differently—a caustic mixture of brutal police crackdowns on street homelessness, punitive plans to evict homeless children and families from shelters to the streets, and a 32 percent rise in New York City’s homeless-shelter population. But why bother with facts?

The attacks on de Blasio’s homeless record began, first, as a low rumble, before crescendoing into a multipart chorus this fall. The head of the Sergeants Benevolent Association, a Republican union chief furiously opposed to policing reform, urged his members to post photos of homeless people to the Internet. And just as stories seeded in the national right-wing media often migrate to mainstream outlets, it wasn’t long before The New York Times and the Daily News were running stories about a supposed explosion in homelessness.

It’s easy to see why de Blasio’s right-wing critics have glommed on to homelessness as one of their preferred weapons in undermining the mayor. Rupert Murdoch’s New York Post (with its unsubtle “Rotting Apple” series) and others have hardly disguised their agenda about painting the mayor as David Dinkins redux. And as de Blasio prepares to mark two years in office, the visibility of homeless people makes for a ready, if cynical, shorthand for all his alleged failures—for taking New York back to the grimy days of crime and disorder (falling crime rates sort of complicate that claim) and for failing to deliver on the one great promise he made to his constituents: to tackle growing inequality.

The only problem is, their analysis is wrong.

There is no question that New York City is suffering a historic homelessness crisis. But it is a crisis that de Blasio inherited, one that is in fact rooted in the failed conservative policies of his predecessors, Michael Bloomberg and Giuliani, and in the worsening housing-affordability crisis in New York. Further exacerbating the problem, New York’s Democratic governor, Andrew Cuomo, has played a consistently destructive role by blocking de Blasio’s efforts to address the crisis.

The mayor has made his share of mistakes, some of which he’s begun to acknowledge. This month saw the departure of the head of the city’s troubled Department of Homeless Services, accompanied by the announcement that the city plans to reorganize the agency and, perhaps, merge it with the larger, better-managed welfare agency. A few days later, de Blasio announced an initiative to better track street homelessness, admitting that the city had been slow to address the problem and that he himself had failed to communicate the full scope of his administration’s approach to homelessness.

Even so, there is hopeful news. While you wouldn’t know it if you read the tabloids, de Blasio and his administration have enacted a series of smart, progressive, housing-based policies to tackle New York City’s homelessness crisis. And thanks to these and other policies, the rapid growth of the homeless population has finally halted, and next year should see the number of homeless New Yorkers decrease.

It’s important to consider both the scale and the history of the crisis. Currently there are more than 59,000 homeless people sleeping each night in New York City’s municipal shelters, three-quarters of them children and their families. And each night, a few thousand more homeless people sleep rough on the streets, in the subway system, and in other public spaces. Over the past decade, the number of homeless New Yorkers bedding down in shelters grew a staggering 86 percent, while the number of homeless children has risen by 90 percent.

Yet, while de Blasio’s critics shriek about the homeless men and women they’ve suddenly taken to noticing on sidewalks and in subways, the vast majority of the growth in homelessness occurred under Bloomberg. The shelter population soared by 71 percent, from 31,000 to more than 53,000 people per night, during the billionaire mayor’s time in office, while the number of homeless families rose by a staggering 87 percent. Along the way, the cost to taxpayers rose, too, with the city’s homeless services budget doubling under Bloomberg to more than $1 billion annually.

Why did family homelessness grow so much in New York? As with other cities with high housing costs, part of the reason was structural—apartment rents rose, while low-wage workers’ incomes stagnated or fell in real terms. During the Great Recession, for instance, the median rent of New York City apartments rose by 8 percent, while the median income for renters fell by 7 percent. Over the past decade the city lost some 400,000 apartments affordable to low-income households. In fact, New York City is in the grips of one of the greatest affordable-housing crises in the country, with rents running so high that a full-time worker earning the minimum wage still earns less each month than the federally set “fair market rent” for a two-bedroom apartment (currently $1,481 per month). This is one reason the number of working homeless families—which make up nearly a third of all families in municipal shelters—rose so precipitously over the past decade.

But the staggering rise in family homelessness is also rooted in failed conservative policies. While Bloomberg billed himself (and was often portrayed in the news media) as a technocrat motivated solely by nuts-and-bolts managerial thinking, he and his administration enacted a set of right-wing policies during his three terms in office that shredded the safety net for the poorest New Yorkers.

The most destructive of these policies was the administration’s decision to eliminate virtually all affordable-housing aid—including federal housing vouchers and public-housing apartments, as well as most city-subsidized apartments—for homeless families, effectively trapping kids and their parents in a ballooning shelter system for longer and longer periods of time. Advocates and academic researchers have long recognized that the best way to help homeless families is to provide them with stable, long-term housing assistance like rental vouchers or public housing. Yet while previous New York City mayors—even Giuliani!—had allocated federal and city-subsidized housing to help homeless families move from shelters to their own homes, Bloomberg cut off federal housing assistance to homeless New Yorkers back in 2005 and eliminated all other housing aid in 2011.

The result was predictable, and tragic. Average stays in family shelters swelled to more than 14 months by the time Bloomberg left office, and the number of homeless children sleeping each night in the shelter system approached 25,000 for the first time in history. And, as with so many things during the Bloomberg era, non-white New Yorkers suffered the most from soaring homelessness. Today, African-Americans and Latinos comprise 88 percent of the homeless-shelter population. Over the course of last year, one of every 17 African-American children in New York City slept in a homeless shelter.

Moreover, despite Bloomberg’s media-crafted image as a management guru, his administration plunged an already-rickety shelter system into further dysfunction. As documented in The New York Times’s groundbreaking investigative series about a homeless girl, Dasani Coates, and her family, municipal shelters under Bloomberg became rife with hazardous conditions like lack of heat, vermin infestation, and fire-safety violations. His administration also cut lucrative deals with known slumlords, paying them tens of millions of dollars annually to shelter families in run-down apartment buildings already cited by city inspectors for numerous health and safety violations.

As a final insult, Bloomberg sought to impose punitive rules that would have harmed homeless children and parents further. He engaged in years of (thankfully, fruitless) litigation aimed at eliminating New York’s landmark legal right to shelter for homeless people, which has saved countless lives, and even tried to force some homeless families to pay as much as $1,000 in monthly rent for shelter. Indeed, a study by independent budget analysts found that, in the midst of the Great Recession and while thousands of poor families lost their homes as a result of joblessness and evictions, the Bloomberg administration denied emergency shelter to a larger and larger share of needy families seeking help.

This is the broken system de Blasio inherited upon taking office in 2014. Nonetheless, de Blasio acted swiftly to address the worsening crisis. In his first weeks in office, he relocated homeless kids from some of the most dangerous shelters—including the horrific Auburn shelter where Dasani had lived for years—and ordered a full-scale investigation of family shelter conditions. He curtailed some of the most punitive Bloomberg policies that made it hard for families to access emergency shelter. And he appointed Steve Banks—the respected head of the Legal Aid Society who’d won numerous legal fights with previous mayors on behalf of homeless families—to run the city’s welfare agency.

However, when de Blasio tried to reinstate affordable-housing programs aimed at helping homeless families move from shelters to stable housing, he hit a powerful obstacle: Andrew Cuomo. New York’s governor, whose hostility to de Blasio is now the stuff of political legend, has repeatedly blocked efforts by the city to expand permanent housing aid for homeless New Yorkers. One of those efforts included a program to provide new rental assistance for homeless families to help them move from shelters to private-market apartments. Rather than support it, Cuomo came close to derailing it last year, ultimately approving a deeply flawed version that the de Blasio administration later had to correct. Cuomo has also repeatedly refused to increase housing allowances for welfare recipients—still stuck, believe it or not, at $400 per month for the typical family—and to enhance rental assistance for families facing eviction.

But Cuomo has been most destructive when it comes to efforts to reduce street homelessness. Although it is impossible to measure street homelessness in New York City with any accuracy, there is strong evidence that the number of unsheltered homeless people—primarily individuals with high rates of serious mental illness and other health problems—has been growing for years. At the same time, the number of homeless single adults in shelters has doubled since 2008.

Two decades of research have shown that the only effective solution to street homelessness is a model of housing called permanent supportive housing, which combines rental subsidies with support services to help people living with disabilities get and maintain treatment. In fact, New York pioneered supportive housing back in the 1980s, and it has since been replicated nationwide. In 1990, an historic state-city agreement between then-Governor Mario Cuomo and then-Mayor David Dinkins created thousands of supportive housing apartments, helping reduce street homelessness in the 1990s. Even Bloomberg and then-Governor (now longer-than-longshot presidential candidate) George Pataki signed a 2005 agreement to create 9,000 supportive housing units. But with that agreement ending and few vacancies in the existing stock of supportive housing, it is no surprise that street homelessness is back on the rise.

Last year, de Blasio and his aides began negotiations with the Cuomo administration to renew the successful state-city agreements of the past, bolstered by ambitious calls from advocates to create 30,000 supportive-housing units over the next decade. But Cuomo adamantly refused to act. Instead, he announced a pitifully small proposal to create only 3,900 housing units—a fraction of the actual need, and far smaller than was provided by the Pataki-Bloomberg agreement—with the city forced to shoulder a larger share of the costs. Coming from the man who had served as federal housing secretary under Bill Clinton and who founded a nonprofit that helps homeless families, Cuomo’s proposal was a shocking and insulting gesture.

So in November, faced with Cuomo’s intransigence and the worsening crisis, de Blasio acted boldly. He announced that, with no help coming from Albany, the city will go it alone to create 15,000 supportive-housing apartments, a $2.6 billion commitment that is the largest local supportive housing initiative in the nation’s history.

As de Blasio’s second year in office winds down, the mayor has created the supports necessary to stem the tide of rising homelessness. The administration recently expanded anti-eviction legal services by $12.3 million to help low-income tenants avoid homelessness. After early struggles, the new rental-assistance programs, combined with federal housing programs, have helped more than 20,000 children and adults move from shelter to their own homes, with more poised to make the move next year. And while the new supportive-housing initiative will roll out over several years, it will eventually provide housing and services for thousands of unsheltered homeless New Yorkers living with disabilities and begin reducing street homelessness—all with virtually no help from Albany.

Still, there are certainly bolder steps that de Blasio can take to address the crisis. The mayor’s affordable-housing plan, slated to build or preserve 200,000 units over the next decade, allocates relatively few apartments to homeless New Yorkers. (By way of comparison, 10 percent of the apartments created under Ed Koch’s legendary 150,000-unit housing plan were set aside for homeless people.)

Advocates also fear that the mayor’s new street-homelessness initiative may involve a return to the harsh criminalization of homelessness that was the mark of the Giuliani era; early reports that police officers will play a role in tracking street homelessness have stoked those fears. And the reorganization of the beleaguered homeless services agency should not only address longstanding bureaucratic dysfunction and poor coordination with other agencies. It should also rapidly implement reforms to improve conditions and services for homeless families and individuals residing in the shelter system, beginning with immediately phasing out the use of slumlord-owned buildings as shelters.

As for Cuomo, he still has time to repair his tarnished legacy. The governor says he will announce his own homeless plan next month, although recent reports raise worrisome questions about whether that plan will be more superficial than substantive, and whether it will include the resources necessary to effect genuine change. Indeed, in a recent public radio interview Cuomo, a longtime fiscal conservative, said that “it’s not just about money”—completely ignoring how the lack of state housing aid has fueled record New York homelessness.

Still, it is not too late for the governor to heed advocates’ call to match the mayor’s commitment to create 15,000 supportive-housing units in New York City. And Cuomo still has time to enhance rental assistance for the poorest New Yorkers, including those on welfare and those facing eviction. Until then, it will be Cuomo’s sad fate to be the Democratic governor who did less to provide housing for homeless New Yorkers than George Pataki.