A. In an action for possession based upon nonpayment of rent or in an action for rent by a landlord when the tenant is in possession, the tenant may assert as a defense that there exists upon the leased premises, a condition which constitutes or will constitute, a fire hazard or a serious threat to the life, health or safety of occupants thereof, including but not limited to a lack of heat or running water or of light or of electricity or adequate sewage disposal facilities or an infestation of rodents, or a condition which constitutes material noncompliance on the part of the landlord with the rental agreement or provisions of law. The assertion of any defense provided for in this section shall be conditioned upon the following:
1. Prior to the commencement of the action for rent or possession, the landlord or his agent was served a written notice of the aforesaid condition or conditions by the tenant or was notified by a violation or condemnation notice from an appropriate state or municipal agency, but that the landlord has refused, or having a reasonable opportunity to do so, has failed to remedy the same. For the purposes of this subsection, what period of time shall be deemed to be unreasonable delay is left to the discretion of the court except that there shall be a rebuttable presumption that a period in excess of thirty days from receipt of the notification by the landlord is unreasonable; and
B. It shall be a sufficient answer to such a defense provided for in this section if the landlord establishes the conditions alleged in the defense do not in fact exist; or such conditions have been removed or remedied; or such conditions have been caused by the tenant or members of the family of such tenant or of his or their guests; or the tenant has unreasonably refused entry to the landlord to the premises for the purposes of correcting such conditions.
C. The court shall make findings of fact upon any defense raised under this section or the answer to any defense and, thereafter, shall pass such order as may be required including any one or more of the following:
1. An order to set-off to the tenant as determined by the court in such amount as may be equitable to represent the existence of any condition set forth in subsection A which is found by the court to exist;
3. Refer any matter before the court to the proper state or municipal agency for investigation and report and grant a continuance of the action or complaint pending receipt of such investigation and report. When such a continuance is granted, the tenant shall deposit with the court any rents which will become due during the period of continuance, to be held by the court pending its further order or in its discretion the court may use such funds to pay a mortgage on the property in order to stay a foreclosure, to pay a creditor to prevent or satisfy a bill to enforce a mechanic’s or materialman’s lien, or to remedy any condition set forth in subsection A which is found by the court to exist.
D. If it appears that the tenant has raised a defense under this section in bad faith or has caused the violation or has unreasonably refused entry to the landlord for the purpose of correcting the condition giving rise to the violation, the court, in its discretion, may impose upon the tenant the reasonable costs of the landlord, including court costs, the costs of repair where the court finds the tenant has caused the violation, and reasonable attorney’s fees.
1974, c. 680; 1982, c. 260; 2000, c. 760.