A tenant who complained about the conditions in his apartment had the right to challenge his eviction on the basis of retaliation by the landlord, the Minnesota Supreme Court ruled on Wednesday.

Housing attorneys hailed the 5-2 decision, saying it expanded the legal rights of tenants in similar cases.

"It is very rare for a court of any type to recognize a new right that hasn't been created by the Legislature," Lawrence McDonough, pro bono counsel for the Dorsey & Whitney law firm and one of the attorneys who represented the tenant in the appeal. "What the court did today was assert the broad right to challenge retaliation in eviction cases."

The tenant, who signed a one-year lease on May 1, 2016, had made several written complaints to his landlord, Central Housing Associates (CHA), regarding maintenance issues and also alleged in writing that the landlord's staff had harassed and discriminated against his minor daughter. The tenant requested anonymity to avoid retaliation from future landlords.

The following January, CHA gave him written notice that his lease would be terminated two months early, effective Feb. 28, 2017. It alleged he'd made multiple breaches of the lease terms, including failing to list all family members on his application and late rent payments.

Before the Feb. 28 deadline, he filed a report with the Minnesota Department of Human Rights, saying a maintenance worker had harassed his daughter, and alleging that CHA had discriminated against him based on a disability and against his daughter based on her religion and race.

The tenant did not move out, and CHA brought an eviction action in district court. The tenant represented himself in the case, and a jury that found that he "materially violated the terms of the lease" but that CHA had retaliated against him. A district court judge ruled in favor of the tenant, which CHA appealed.

The state court of appeals reversed the decision, concluding that no retaliatory-eviction defense was available to the tenant under state law.

The Supreme Court majority opinion was authored by Associate Justice David Lillehaug, who found that while state statute did not apply in this case, common law based on principles developed by courts to deal with disputes allowed the tenant to use retaliation as a defense against an eviction.

"Evictions of tenants — some resulting in homelessness — based on their complaints about habitability are inimical to public heath and safety, and welfare," Lillehaug wrote.

"Recognizing a common-law defense of retaliation also encourages tenants and landlords to resolve their disputes, directly, before either side resorts to court. Knowing that they are protected from retaliation, tenants will have an incentive to complain directly to landlords to address alleged violations, rather than first involving governmental entities or the courts."

But Lillehaug added that common law defense should not prevent law-abiding landlords from evicting tenants for material breaches of the law.

Chief Justice Lorie Skjerven Gildea and Justice G. Barry Anderson dissented.

Attorneys Christopher Kalla and Douglass Turner represented the landlord. Kalla declined to comment.

Samuel Spaid and Paul Birnberg, attorneys with HOME Line, a tenant advocacy organization in Minnesota, also represented the tenant.

"I think it's a great decision," Spaid said. "It's going to be very helpful to tenants in Minnesota in enforcing their rights."