WASHINGTON — The U.S. Supreme Court said people who file housing-discrimination suits don’t have to show they were victims of intentional bias, in a blow to lenders and insurers and a surprise legal victory for the Obama administration.

The 5-4 ruling upholds a category of U.S. Fair Housing Act lawsuits that civil rights groups said are especially important — and business groups consider particularly onerous. The court said plaintiffs can base their suits on statistical evidence that a disputed policy has a “disparate impact” on a minority group.

The Obama administration has relied on the disparate-impact approach to get hundreds of millions of dollars in fair-lending settlements with Bank of America, Wells Fargo and other financial companies.

“Recognition of disparate impact claims is consistent with FHA’s central purpose,” Justice Anthony Kennedy wrote for the court. The law was “enacted to eradicate discriminatory practices within a sector of our nation’s economy.”

Kennedy said disparate-impact cases should be “properly limited” so that those sued under the law have an opportunity to argue that their policies serve valid interests. He warned against the risk of “abusive” impact claims that could cause private developers to not construct low-income housing.

“Then the FHA would have undermined its own purpose as well as the free-market system,” Kennedy said.

The ruling defied expectations. The court under Chief Justice John Roberts had eliminated decades-old protections for racial minorities in other contexts, and the justices had given every indication that disparate-impact suits were next.

Housing and Urban Development Secretary Julian Castro applauded the court’s decision, saying it protects equal opportunity for Americans.

“The Supreme Court has made it clear that HUD can continue to use this critical tool to eliminate the unfair barriers that have deferred and derailed too many dreams,” Castro said in a statement.

The decision was also praised by housing advocates. John Taylor, president of the National Community Reinvestment Coalition, said disparate-impact claims are a vital tool for enforcing fair-housing laws.

“For many years, the application of disparate-impact doctrine has helped to expose housing practices that may appear neutral on their face but have discriminatory effects on protected classes,” Taylor said.

The court took up the case in October even though the issue appeared settled, with every federal appeals court to consider the matter saying that disparate-impact suits were allowed. The court had to grant review in three cases before having a chance to rule. Two other cases accepted earlier were scuttled when civil rights advocates engineered settlements.

Justice Samuel Alito, in a dissent joined by the chief justice, Justice Antonin Scalia and Justice Clarence Thomas, said the housing law prohibits only intentional discrimination, not practices that have only an adverse effect. The majority’s opinion will have “unfortunate consequences” for those the law is designed to help, Alito said.

“Disparate impact puts housing authorities in a very difficult position because programs that are designed and implemented to help the poor can provide the grounds for a disparate-impact claim,” he wrote.

The ruling may also apply to the Equal Credit Opportunity Act, a second law invoked by the Obama administration against Bank of America and Wells Fargo.

The Consumer Financial Protection Bureau has relied on the disparate-impact doctrine in enforcing that law, which contains language similar to that in the Fair Housing Act. ECOA, as the law is known, covers auto lending as well as mortgages.

“There is no place in this industry for those who intentionally discriminate against borrowers,” John Mechem, a spokesman for the Mortgage Bankers Association in Washington, said in an emailed statement. “It is incumbent on all lenders to ensure that they are compliant with the interpretation of the law communicated by the court today.”

In the case before the court, Texas was fighting a lawsuit by the Inclusive Communities Project, a Dallas-based group that advocates for racially integrated housing. The organization accused state officials of thwarting integration by allocating a disproportionate number of federal low-income housing tax credits to minority neighborhoods.

A federal appeals court had said the lawsuit could go forward.

Texas Attorney General Ken Paxton said in a statement that the high court decision “places an unfair burden on landlords, lenders and developers, and will ironically lead them to make their decisions based upon consideration of race.”