§ 1174.2.Affirmative Defense of Breach of Landlord's Obligations Or Warranty of Habitability Raised In Unlawful Detainer Proceeding
Title 3. Of Summary Proceedings · Chapter 4. Summary Proceedings for Obtaining Possession of Real Property in Certain Cases · Last amended 1994 · Last verified July 29, 2026
In one sentenceSection 1174.2 lets a residential tenant sued for nonpayment of rent defeat the eviction by proving the landlord substantially breached the habitability warranty, in which case the court sets a reduced rental value, awards possession to the tenant conditioned on paying the adjusted rent promptly, may order repairs, and may award the tenant fees and costs.
(a)In an unlawful detainer proceeding involving residential premises after default in payment of rent and in which the tenant has raised as an affirmative defense a breach of the landlord's obligations under Section 1941 of the Civil Code or of any warranty of habitability, the court shall determine whether a substantial breach of these obligations has occurred. If the court finds that a substantial breach has occurred, the court (1) shall determine the reasonable rental value of the premises in its untenantable state to the date of trial, (2) shall deny possession to the landlord and adjudge the tenant to be the prevailing party, conditioned upon the payment by the tenant of the rent that has accrued to the date of the trial as adjusted pursuant to this subdivision within a reasonable period of time not exceeding five days, from the date of the court's judgment or, if service of the court's judgment is made by mail, the payment shall be made within the time set forth in Section 1013, (3) may order the landlord to make repairs and correct the conditions which constitute a breach of the landlord's obligations, (4) shall order that the monthly rent be limited to the reasonable rental value of the premises as determined pursuant to this subdivision until repairs are completed, and (5) except as otherwise provided in subdivision (b), shall award the tenant costs and attorneys' fees if provided by, and pursuant to, any statute or the contract of the parties. If the court orders repairs or corrections, or both, pursuant to paragraph (3), the court's jurisdiction continues over the matter for the purpose of ensuring compliance. The court shall, however, award possession of the premises to the landlord if the tenant fails to pay all rent accrued to the date of trial, as determined due in the judgment, within the period prescribed by the court pursuant to this subdivision. The tenant shall, however, retain any rights conferred by Section 1174.
(b)If the court determines that there has been no substantial breach of Section 1941 of the Civil Code or of any warranty of habitability by the landlord or if the tenant fails to pay all rent accrued to the date of trial, as required by the court pursuant to subdivision (a), then judgment shall be entered in favor of the landlord, and the landlord shall be the prevailing party for the purposes of awarding costs or attorneys' fees pursuant to any statute or the contract of the parties.
(c)As used in this section, "substantial breach" means the failure of the landlord to comply with applicable building and housing code standards which materially affect health and safety.
(d)Nothing in this section is intended to deny the tenant the right to a trial by jury. Nothing in this section shall limit or supersede any provision of Chapter 12.75 (commencing with Section 7060) of Division 7 of Title 1 of the Government Code.
Plain-English Summary
A tenant facing eviction for unpaid rent isn't limited to arguing the rent was already paid. If the tenant raises a substantial breach of the landlord's obligations under Civil Code § 1941 or the warranty of habitability as an affirmative defense, subdivision (a) requires the court to decide whether that breach really happened. "Substantial breach" means the landlord failed to meet building and housing code standards that materially affect health and safety, as subdivision (c) defines it.
Finding a substantial breach triggers a specific set of consequences: the court sets the reasonable rental value of the unit in its unfit condition up to the trial date, denies the landlord possession and names the tenant the prevailing party — but only if the tenant pays the accrued, adjusted rent within a short window, usually five days from judgment (or the § 1013 mail-service period). The court may also order repairs and keeps jurisdiction to make sure they happen, caps monthly rent at the reduced value until repairs are done, and generally awards the tenant fees and costs if a statute or the lease provides for them.
If the court finds no substantial breach, or the tenant doesn't pay the adjusted rent in time, the landlord wins and becomes the prevailing party for fee purposes instead. Either way, subdivision (d) makes clear this defense doesn't take away the right to a jury trial preserved by § 1171, and it doesn't override the Government Code's rent-related provisions in Chapter 12.75 of Division 7 of Title 1.
Frequently Asked Questions
Can I defend an eviction by showing my landlord wouldn't fix serious problems in my unit?
Yes. Raising a substantial breach of the habitability warranty or Civil Code § 1941 as an affirmative defense lets the court reduce the rent owed and, if you pay the adjusted amount promptly, deny the landlord possession.
What counts as a "substantial breach" for this defense?
A landlord's failure to meet applicable building and housing code standards that materially affect health and safety.
What happens to my rent if I win this defense?
The court sets the reasonable rental value of the unit in its unfit condition, and monthly rent stays capped at that value until repairs are completed.
What if I win the defense but don't pay the reduced rent in time?
The court must still award the landlord possession if you fail to pay the full adjusted rent within the period the court sets.
Amendment History
Amended by Stats. 1993, Ch. 589, Sec. 28. Effective January 1, 1994.
Source & verification. Section text is reproduced verbatim from
the Deering's California Codes Annotated / vLex. Enacted by the California Legislature.
Last verified July 29, 2026.
· Official source
Also known as:habitability defense eviction californiawarranty of habitability nonpayment of rent california