On Monday, the conservative effort to hobble the Fair Housing Act failed once again at the Supreme Court. By a 5-3 vote, the justices ruled that, under the FHA, cities can sue banks whose predatory lending practices increase segregation. This time around, Chief Justice John Roberts joined the liberals in embracing a broad theory of standing that lets municipalities go after discriminatory banks. His unexpected vote allowed the court to strengthen the FHA and affirmed progressive cities’ role in combatting housing segregation in the United States.

Bank of America v. Miami, Monday’s decision, arose out of a straightforward lawsuit that Miami filed against Wells Fargo and Bank of America. According to the city, these banks targeted minorities for extremely risky mortgages that came with high interest rates and exorbitant fees. Miami alleges that the banks knew many of these borrowers had bad credit and little cash, yet offered them loans anyway. When the borrowers asked to refinance or modify their original loans, the banks refused, inducing foreclosure. In court filings, Miami provided data indicating that banks were significantly more likely to offer these predatory loans to minorities than to white people.

The city sued under the FHA, alleging that the banks had engaged in racially discriminatory lending practices. Nobody doubts that, if Miami’s allegations are true, the banks violated the FHA. But Wells Fargo and Bank of America argued that the city lacks standing to bring such a suit. The FHA permits only an “aggrieved person” to sue violators of the statute, defining the term as “any person who … claims to have been injured by a discriminatory housing practice.” Miami, the banks argued, cannot qualify as an “aggrieved person,” because the FHA “is primarily about obtaining redress for individual injury, not vindicating public rights.”

Writing for the majority, Justice Stephen Breyer flatly rejected that argument. Breyer noted that Miami was injured: The banks’ alleged discrimination caused widespread foreclosures and vacancies in the city’s minority communities, decreasing the value of both the foreclosed homes and the affected neighborhoods. In turn, this decline in property values decreased property-tax revenues, hurting the city’s bottom line. In addition, the foreclosures forced the city to spend more on municipal services to remedy blight and unsafe conditions.

Miami, in other words, is receiving less tax revenue from blighted neighborhoods while spending more to help those same neighborhoods—all because of the banks’ alleged discrimination. And that, Breyer wrote, puts the city “within the FHA’s zone of interests,” giving it standing to sue. This finding, he wrote, aligns with Congress’ “intent to confer standing broadly” under the FHA.

A fascinating amicus brief filed by the Constitutional Accountability Center shows Breyer’s conclusion is supported by the historical record. When the FHA was first proposed in 1968, the idea was to allow the Department of Housing and Urban Development to enforce the law directly—by, for instance, ordering racist landlords to cease and desist their discriminatory practices or face sanctions. The bill’s sponsors, though, eliminated this enforcement mechanism to obtain support from a key senator. To compensate for their bill’s resulting reliance on private litigation, the drafters instead included a broad definition of an “aggrieved person,” one that would allow them to sweep in as many plaintiffs as possible.

The Supreme Court has long recognized the FHA’s extensive reach. In fact, the court already ruledthat a municipality can sue FHA violators whose discrimination diminishes tax revenue. To throw out Miami’s lawsuit, the court would’ve had to reverse this precedent—something the chief justice, it seems, was not prepared to do. Roberts’ decision to side with the liberals in this case is, as always, a bit mysterious. But it’s easy to see the upside of his vote. In addition to preserving precedent, Monday’s decision avoided a stalemate: Justice Neil Gorsuch had not yet joined the bench when the case was argued, so if Roberts had voted with his fellow conservatives, the case would’ve deadlocked 4-4. An impasse would’ve simply preserved the lower court’s ruling.

That brings us to one last reason why Roberts might’ve joined Breyer’s opinion without reservation. The lower court’s decision actually reached further than Breyer’s, subjecting the banks to untold millions in damages. Breyer’s opinion reined in this ruling in a Roberts-friendly manner by limiting cities’ ability to make banks pay them back for the harms they inflicted. Miami, Breyer wrote, cannot collect damages from Bank of America and Wells Fargo unless it can prove “some direct relation between the injury asserted and the injurious conduct alleged.” But the court did not define what, exactly, constitutes a “direct relation.” Given that uncertainty, some cities may decline to sue FHA violators, deciding it isn’t worth devoting time, energy, and resources to a court battle that won’t even result in restitution.

Two years ago, the court reached a similar compromise to preserve the FHA’s disparate impact prong, allowing plaintiffs to win without proving discriminatory intentwhile making those victories more difficult to achieve. Back then, Justice Anthony Kennedy provided the liberals a fifth vote; this time, Roberts swung left, with Kennedy dissenting. Although it’s heartening to see the law survive two consecutive attacks, it’s also distressing to see the law evade these maulings by such slim margins. The FHA is still very much in danger. And with Gorsuch on the court and more vacancies looming, conservatives may soon have an opportunity to land a real body blow against fair housing in America.