WASHINGTON — The Supreme Court on Tuesday weighed whether cities can sue banks under the Fair Housing Act for predatory lending, even if foreclosures that stem from such loans affect a city only indirectly.

The case before the justices was brought by Miami after the 2008 financial crisis. The city said that discriminatory mortgage lending practices by Bank of America and Wells Fargo had led to a disproportionate number of defaults by minority home buyers and, in turn, to financial harm to the city.

“We are aggrieved in every sense of the word by the discrimination that was propounded here,” said Robert S. Peck, a lawyer for the city.

The justices appeared divided over whether Miami’s asserted injuries were enough to allow it to sue under the housing law.