The U.S. Supreme Court ruled Monday that Miami can sue Bank of America and Wells Fargo under the Fair Housing Act of 1968, a judgement that allows other cities to sue banks that may have preyed upon people of color by targeting them for high-risk loans.

The ruling was not a total win for Miami, because the Court agreed with a lower court finding that says the city must prove the damage done by banks was more than a foreseeable outcome. The Court ruled 5 to 3, with Chief Justice John Roberts joining the four liberal justices, and Justice Stephen Breyer writing the majority decision. The case now returns to the federal appeals court in Atlanta, which will determine how far cities must go to prove the banks knowingly wronged them.

The case arose from the financial crisis in 2008, and in 2013 Miami filed a lawsuit against Bank of America and Wells Fargo, after widespread investigations alleged the banks unfairly targeted people of color with bad mortgages. The case has now become a bellwether for other cities looking to recoup losses under the FHA. Miami accused both banks of discriminatory lending practices that led to neighborhood-wide foreclosures in mostly black and Latino communities. The banks did this, Miami argued, by lending to these customers on worse terms than other borrowers with similar credit. The banks then failed to extend refinancing and loan modifications to these borrowers. Miami said this caused undue financial harm on the city because it increased segregation, it lost out on property taxes, lowered property values, and forced the city to provide more municipal services. Financial institutions have been sued in the past by individual people claiming discrimination, but this is the first time a city representing entire communities have attempted a lawsuit. It was on these grounds a trial court originally dismissed the suit; the Eleventh Circuit Court of Appeals in Atlanta reversed the lower court’s decision in 2015.