A Hennepin County judge on Thursday struck down a Minneapolis ordinance that bars landlords from screening out prospective tenants who use Section 8 vouchers.

The ruling means the law, which went into effect May 1, cannot be enforced unless a higher court restores it.

“We are reviewing next steps and will undoubtedly appeal,” said City Attorney Susan Segal. “We strongly disagree with the court’s conclusions.”

Under the ordinance, passed in 2017, landlords were allowed to screen tenants but no longer could exclude all Section 8 tenants — a common statement on apartment listings. The ordinance granted reprieve for landlords who could show compliance would create an “undue hardship,” though only after a discrimination claim was filed with the city’s Civil Rights Department.

Shortly after the City Council passed the ordinance, 55 apartment owners who control more than 3,200 units in the city sued to stop it. Even after the law went into effect last month, landlords continued to forbid Section 8 holders in their listings.

District Judge Bruce Peterson ruled that the ordinance violates landlords’ due process rights by presuming that any owner who does not accept Section 8 vouchers is motivated by prejudice, even though landlords argue that they have business reasons for refusing the vouchers.

Meanwhile, the ordinance exempts owner-occupied duplexes, which Peterson found perplexing. If the reason to prohibit barring Section 8 vouchers from properties is because landlords are motivated by prejudice, he argued, “personal biases may be more likely to come into play” in the case of a duplex, where the landlord and renter share a wall and a yard.

The ordinance is “unconstitutionally arbitrary” and violates the plaintiffs’ equal protection under the law, Peterson wrote.

“It is apparent from the record that the ordinance is the result of hard work by many people of good will. Its invalidity will be a setback to them,” he wrote. “However, in our constitutional system the means chosen to accomplish even a laudable goal must not transgress the constitutional rights of those affected.”

A city document from March 2017 said less than 6 percent of the city’s rental units would be affected by the ordinance, given how many vouchers are used in the city.

Renters receiving housing vouchers typically pay a portion of their rent, with the voucher making up the rest.

An attorney for the landlords could not be reached for comment.

In a statement, Minneapolis Public Housing Authority spokesman Jeff Horwich said the ordinance was “an important step in removing long-standing and often overt discrimination” against people with vouchers.

“While we did not expect it to be a silver bullet, we hoped it would open up more places to live for these families, more widely across the city,” Horwich said.