Opinion
Under traditional common law doctrine, long followed in California, a landlord was under no duty to maintain leased dwellings in habitable condition during the. term of the lease. In the past several years, however, the highest courts of a rapidly growing number of states and the District of Columbia have reexamined the bases of the old common law rule and have uniformly determined that it no longer corresponds to the realities of the modern urban landlord-tenant relationship. Accordingly, each of these jurisdictions has discarded the old common law rule and has adopted an implied warranty of habitability for residential leases.
1
In June 1972, the California Court of Appeal reviewed this emerging out-of-state precedent in the case of
Hinson
v.
Delis
(1972)
For the reasons discussed below, we have determined that the Hinson court properly recognized a common law implied warranty of habitability in residential leases in California, and we conclude that the breach of such warranty may be raised as a defense in an unlawful detainer action.
*620 First, as the recent line of out-of-state cases comprehensively demonstrate, the factual and legal premises underlying the original common law rule in this area have long ceased to exist; continued adherence to the time-worn doctrine conflicts with the expectations and demands of the contemporary landlord-tenant relationship and with modern legal principles in analogous fields. To remain viable, the common law must reflect the realities of present day society; an implied warranty of habitability in residential leases must therefore be recognized.
Second, we shall point out that the statutory “repair and deduct” provisions of Civil Code section 1941 et seq. do not preclude this development in the common law, for such enactments were never intended to be the exclusive remedy for tenants but have always been viewed as complementary to existing common law rights.
Finally, we have concluded that a landlord’s breach of this warranty of habitability may be raised as a defense in an unlawful detainer action. Past California cases have established that a defendant in an unlawful detainer action may raise any affirmative defense which, if established, will preserve the tenant’s possession of the premises. As we shall explain, a landlord’s breach of a warranty of habitability directly relates to whether any rent is “due and owing” by the tenant; hence, such breach may be determinative of whether the landlord or tenant is entitled to possession of the premises upon nonpayment of rent. Accordingly, the tenant may properly raise the issue of warranty of habitability in an unlawful detainer action.
1. The facts of the instant case.
We begin with a brief review of the facts of the instant case, which reveal a somewhat typical unlawful detainer action. On September 27, 1972, the landlord Jack Sumski commenced an unlawful detainer action in the San Francisco Small Claims Court seeking possession of the leased premises and $300 in back rent. The tenant admitted nonpayment of rent but defended the action on the ground that the landlord had failed to maintain the leased premises in a habitable condition. The small claims court awarded possession of the premises , to the landlord and entered a money judgment for $225 against the tenant.
The tenant then appealed the decision to the San Francisco Superior Court, where a de novo trial was held pursuant to section 117j of the Code of Civil Procedure. In support of his claim of uninhabitability, the tenant submitted a copy of an October 1972 inspection report of the San Francisco Department of Public Works disclosing some 80 housing code *621 violations in the building in question, as well as an order of the department scheduling a condemnation hearing for January 19, 1973. In addition, in testimony at trial, petitioner and his roommate detailed a long list of serious defects in the leased premises which had not been repaired by the landlord after notice and which they claimed rendered the premises uninhabitable. Some of the more serious defects described by the tenants included (1) the collapse and nonrepair of the bathroom ceiling, (2) the continued presence of rats, mice, and cockroaches on the premises, (3) the lack of any heat in four of the apartment’s rooms, (4) plumbing blockages, (5) exposed and faulty wiring, and (6) an illegally installed and dangerous stove. 3 The landlord apparently did not attempt to contest the presence of serious defects in the leased premises, but instead claimed that such defects afforded the tenant no defense in an unlawful detainer action.
The superior court judge ultimately agreed with the landlord’s contention, holding that the “repair and deduct” provisions of Civil Code section 1941 et seq. constituted the tenant’s exclusive remedy under these circumstances. 4 Accordingly, the superior court entered judgment for the landlord, awarding him $225 and possession of the premises.
The tenant thereafter sought certification and transfer of the case to the Court of Appeal (see Cal. Rules of Court, rules 62, 63), but the superior court denied the request. The tenant then sought a writ of mandate or prohibition from the Court of Appeal, contending that the trial court had erroneously failed to follow the
Hinson
decision. The Court of Appeal denied the writ summarily; the tenant thereafter sought a hearing in this court. Because of the statewide importance of the general issues presented (cf.
Treber
v.
Superior Court
(1968)
2. The transformation of the landlord-tenant relationship and developments in analogous areas of law compel the recognition of a common law implied warranty of habitability in residential leases in California.
At common law, the real estate lease developed in the field of real property law, not contract law. .Under property law concepts, a lease was considered a conveyance or sale of the premises for a term of years, subject to the ancient doctrine of caveat emptor. Thus, under traditional common law rules, the landlord owed no duty to place leased premises in a habitable condition and no obligation to repair the premises. (3 Holdsworth, A History of English Law (5th ed. 1966) pp. 122-123; see, e.g.,
Brewster
v.
DeFremery
(1867)
In recent years, however, a growing number of courts have begun to re-examine these “settled”- common law rules in light of contemporary conditions, and, after thorough analysis, all of these courts have discarded the traditional doctrine as incompatible with contemporary social conditions and modern legal values. This emerging line of decisions, along with a veritable flood of academic commentaries, 7 demonstrates the obsolescence of the traditional common law rule absolving a landlord of any duty to maintain leased premises in a habitable condition during the term of the lease.
The recent decisions recognize initially that the geographic and economic conditions that characterized the agrarian lessor-lessee transaction have been entirely transformed in the modern urban landlord-tenant relationship. We have suggested that in the Middle Ages, and, indeed, until the urbanization of the industrial revolution, the land itself was by far the most important element of a lease transaction; this predominance explained the law’s treatment of such leases as conveyances of interests in land. In today’s urban residential leases, however, land as such plays no comparable role. The typical city dweller, who frequently leases an apartment several stories above the actual plot of land on which an apartment building rests, cannot realistically be viewed as acquiring an interest in land; rather, he has contracted for a place to live. As the Court of Appeal for the District of Columbia observed in
Javins
v.
First National Realty Corporation
(1970)
*624
In the past, California courts have increasingly recognized the largely contractual nature of contemporary lease agreements and have frequently analyzed such leases’ terms pursuant to contractual principles. (See, e.g.,
Medico-Dental etc. Co.
v.
Horton & Converse
(1942)
Modern urbanization has not only undermined the validity of utilizing general property concepts in analyzing landlord-tenant relations, but it has also significantly altered the factual setting directly relevant to the more specific duty of maintaining leased premises. As noted above, at the inception of the common law rule, any structure on the leased premises was likely to be of the most simple nature, easily inspected by the lessee to determine if it fit his needs, and easily repairable by the typically versatile tenant farmer. Contemporary urban housing and the contemporary urban tenant stand in marked contrast to this agrarian model.
First, the increasing complexity of modern apartment buildings not only renders them much more difficult and expensive to repair than the living quarters of earlier days, but also makes adequate inspection of the premises by a prospective tenant a virtual impossibility; complex heating, electrical and plumbing systems are hidden from view, and the landlord, who has had experience with the building, is certainly in a much better position to discover and to cure dilapidations in the premises. Moreover, in a multiple-unit dwelling repair will frequently require access to equipment and areas solely in the control of the landlord.
Second, unlike the multi-skilled lessee of old, today’s city dweller generally has a single, specialized skill unrelated to maintenance work. Furthermore, whereas an agrarian lessee frequently remained on a single plot of land for his entire fife, today’s urban tenant is more mobile than ever; a tenant’s limited tenure in a specific apartment will frequently not justify efforts at extensive repairs. Finally, the expense of needed repairs will often be outside the reach of many tenants for “[l]ow and middle
*625
income tenants, even if they were interested in making repairs, would be unable to obtain any financing for major repairs since they have no long-term interest in the property.”
(Javins
v.
First National Realty Corporation
(1970)
In addition to these significant changes, urbanization and population growth have wrought an enormous transformation in the contemporary housing market, creating a scarcity of adequate low cost housing in virtually every urban setting. 8 This current state of the housing market is by no means unrelated to the common law duty to maintain habitable premises. For one thing, the severe shortage of low and moderate cost housing has left tenants with little bargaining power through which they might gain express warranties of habitability from landlords, and thus the mechanism of the “free market” no longer serves as a viable means for fairly allocating the duty to repair leased premises between landlord and tenant. 9 For another, the scarcity of adequate housing has limited further the adequacy of the tenant’s right to inspect the premises; .even when defects are apparent the low income tenant frequently has no realistic alternative but to accept such housing with the expectation that the landlord will make the necessary repairs. Finally, the shortage of available low cost housing has rendered inadequate the few remedies that common law courts previously have developed to ameliorate the harsh consequences of the traditional “no duty to repair” rule. 10
*626
These enormous factual changes in the landlord-tenant field have been paralleled by equally dramatic changes in the prevailing legal doctrines governing commerical transactions. Whereas the traditional common law “no duty to maintain or repair” rule was steeped in the caveat emptor ethic of an earlier commercial era (see, e.g.,
Nelson
v.
Meyers
(1928)
*627
In most significant respects, the modem urban tenant is in the same position as any other normal consumer of goods. (See Note,
The Tenant as Consumer
(1971) 3 U.C. Davis L.Rev. 59.) Through a residential lease, a tenant seeks to purchase “housing” from his landlord for a specified period of time. The landlord “sells” housing, enjoying a much greater opportunity, incentive and capacity than a tenant to inspect and maintain the condition of his apartment building. A tenant may reasonably expect that the product he is purchasing is fit for the purpose for which it is obtained, that is, a living unit. Moreover, since a lease contract specifies a designated period of time during which the tenant has a right to inhabit the premises, the tenant may legitimately expect that the premises will be fit for such habitation for the duration of the term of the lease. It is just such reasonable expectations of consumers which the modern “implied warranty” decisions endow with formal, legal protection. (Cf.
Gray
v.
Zurich Insurance Co.
(1966)
Finally, an additional legal development casts significant light upon the continued vitality of the traditional common law rule. The past half century has brought the widespread enactment of comprehensive housing codes throughout the nation; in California, the Department of Housing and Community Development has established detailed, statewide housing regulations (see Health & Saf. Code, § 17921; Cal. Admin. Code, tit. 25, §§ 1000-1090), and the Legislature has expressly authorized local entities to impose even more stringent regulations. (See Health & Saf. Code, § 17951.) These comprehensive housing codes affirm that, under contemporary conditions, public policy compels landlords to bear the primary responsibility for maintaining safe, clean and habitable housing in our state. As the Supreme Court of Wisconsin declared with respect to that state’s housing code: “[T]he legislature has made a policy judgment—that it is socially (and politically) desirable to impose these duties on a property owner—which has rendered the old common law rule obsolete. To follow the old rule of no implied warranty of habitability in leases would, in our opinion, be inconsistent with the current legislative policy concerning housing standards.”
(Pines
v.
Perssion
(1961)
*628 Unquestionably these numerous factual and legal developments have completely eroded the foundations of the traditional common law rule. As noted earlier, the highest courts of seven of our sister states and the Circuit Court of Appeals for the District of Columbia have discarded the traditional common law doctrine, and have explicitly recognized an implied warranty of habitability in residential leases. The Supreme Court of Wisconsin was the first to adopt this approach in 1961, and since 1969 the Supreme Courts of Hawaii, New Jersey, New Hampshire, Illinois, Iowa, and Massachusetts and the Circuit Court of Appeals for the District of Columbia have followed this lead. 12
The Court of Appeal decision in
Hinson
v.
Delis
(1972)
The tenant filed a declaratory judgment action seeking a declaration that her obligation to pay full rent was dependent upon the landlord’s compliance “with his duty to substantially obey the housing codes and make the premises habitable,” and also seeking to enjoin the landlord from evicting her during the pendency of the action. The landlord agreed not to evict the plaintiff during the court proceedings, but the trial court concluded that although the landlord had violated several housing code regulations, the *629 plaintiff had no legal or equitable right to unilaterally withhold rent. Accordingly, the trial court entered a declaratory judgment that the tenant owed the landlord the full back rent.
The Court of Appeal, however, relying heavily on the line of out-of-state decisions cited above, reversed the trial court’s judgment and held that a warranty of habitability was implied by law in the tenant’s lease, and that a landlord’s breach of such warranty could justify a tenant’s refusal to pay the full amount of the rent. The
Hinson
court emphasized, however, that “the tenant is not absolved from all liability for rent, but remains liable for the reasonable rental value of the premises, as determined by the trial court, for such time as the premises were in violation of the housing codes.” (
For the reasons discussed at length above, we believe that the traditional common law rule has outlived its usefulness; we agree with the Hinson court’s determination that modem conditions compel the recognition of a common law implied warranty of habitability in residential leases.
3. The “repair and deduct’ remedy of section 1941 et seq. of the Civil Code was not intended as the exclusive remedy for tenants in this field and does not preclude the recognition of a common law warranty of habitability.
The landlord in the present case suggests, however, that sections 1941 through 1942.1 of the Civil Code foreclose this court from adopting a common law implied waranty of habitability. In general, these sections place a statutory duty of maintenance and repair upon lessors of residential property and authorize a tenant, after giving reasonable notice of “dilapidations” to his landlord, either to quit the premises without further liability for rent or to repair the dilapidations himself and to deduct the cost of such repairs—up to one month’s rent—from his rent. A 1970 amendment to section 1942 prohibits a tenant from using the “repair and deduct” option more often than “once in any 12-month period.” The landlord argues that the remedies provided the tenant in section 1942 were intended as the exclusive remedies for any failure of the landlord in his duty to repair. As noted earlier, the trial court in the instant case accepted the landlord’s contention on this point, but we do not agree.
Although past cases have held that the Legislature intended the remedies afforded by section 1942 to be the sole procedure for enforcing the statutory duty on landlords imposed by section 1941 (see, e.g.,
Van Every
v.
*630
Ogg
(1881)
In the century since the statutes were first enacted, for example, California courts have evolved the “constructive eviction” doctrine as a common law remedy completely independent of this statutory framework; under the modern constructive eviction decisions, a tenant’s right to terminate his lease has not been measured by the standards of sections 1941 or 1942, but by the developing standard that permits abandonment whenever a landlord’s “acts or omissions [render the premises] unfit for the purposes for which they were leased.”
(Groh
v.
Kover’s Bull Pen, Inc.
(1963)
Furthermore, the limited nature of the “repair and deduct” remedy, in itself, suggests that it was not designed to serve as an exclusive remedy for tenants in this area. As noted above, section 1942 only permits a tenant to expend up to one month’s rent in making repairs, and now also provides that this self-help remedy can be invoked only once in any 12-month period. These limitations demonstrate that the Legislature framed the section only
*631
to encompass relatively minor dilapidations in leased premises. (See
Nelson
v.
Myers
(1928)
Thus, we conclude that Civil Code section 1941 et seq. do not preclude the development of new common law principles in this area, and we now hold that a warranty of habitability is implied by law in residential leases in California.
4. A tenant may raise a landlord’s breach of an implied warranty of habitability as a defense in an unlawful detainer proceeding.
The landlord in a companion case (see fn. 2) contends, however, that even if we should uphold such a warranty, we could never permit a tenant to raise a landlord’s breach of it in an unlawful detainer action. Relying initially on the fact that the Hinson decision itself involved a declaratory judgment action and not an unlawful detainer action, the landlord maintains that the trial court’s refusal to permit the defense of a “warranty of habitability” in the instant case fully conforms with Hinson. We cannot agree.
In the first place, nothing in the
Hinson
decision supports such a distinction. Although the issue in
Hinson
arose in a declaratory judgment context, as we discuss below the decision itself endorses procedural protections which were specifically designed for unlawful detainer proceedings. (See
infra,
at pp. 636-637.) Moreover, a number of the out-of-state decisions on which the
Hinson
court based its opinion explicitly applied this warranty of habitability doctrine in an unlawful detainer context. (See
Marini
v.
Ireland
(1970)
Second, and more fundamentally, we have concluded that even apart from the Hinson decision, no legal doctrine bars a tenant from raising such a critical defense in an unlawful detainer action. We note initially that absolutely nothing in the statutory provisions governing unlawful detainer proceedings prohibits the assertion of any defense. 16
The landlord contends, however, that to preserve the summary nature of the procedure, California courts have in the past limited the matters which may be raised by a defendant in an unlawful detainer action, and that these judicially created limits foreclose the tenant from utilizing a breach of warranty defense.
The doctrine invoked by the landlord was most recently analyzed by our court in
Knowles
v.
Robinson
(1963)
The basic teaching of Knowles, Lakeside, and the entire line of cases these decisions reflect, 17 is that a defense normally permitted because it “arises out of the subject matter” of the original suit is generally excluded *633 in an unlawful detainer action if such defense is extrinsic to the narrow issue of possession, which the unlawful detainer procedure seeks speedily to resolve. 18 Neither Knowles, Lakeside nor any other California decision, however, prohibits a tenant from interposing a defense which does directly relate to the issue of possession and'which, if established, would result in the tenant’s retention of the premises. 19 The thrust of the Knowles’ line of *634 cases is basically to prevent tenants from frustrating the summary statutory remedy through introduction of extraneous matter; the decisions accomplish this objective by confining the unlawful detainer action to issues directly relevant to the ultimate question of possession.
The crucial issue in this case thus becomes whether a landlord’s breach of a warranty of habitability directly relates to the issue of possession. Holding that such breach was irrelevant to the question of possession, early California cases refused to permit a defense that the landlord had breached a covenant to repair premises. (See, e.g.,
Arnold
v.
Krigbaum
(1915)
*635
The transformation which the residential lease has undergone since the Middle Ages, however, has completely eroded the underpinnings of the “independent covenant” rule. Today the habitability of the dwelling unit has become the very essence of the residential lease; the landlord can as materially frustrate the purpose of such a lease by permitting the premises to become uninhabitable as by withdrawing the use of a portion of the premises. (See fn. 20,
supra)
Thus, in keeping with the contemporary trend to analyze urban residential leases under modern contractual principles, we now conclude that the tenant’s duty to pay rent is “mutually dependent” upon the landlord’s fulfillment of his implied warranty of habitability. (See
Medico-Dental etc. Co.
v.
Horton & Converse
(1942)
Once we recognize that the tenant’s obligation to pay rent and the landlord’s warranty of habitability are mutually dependent, it becomes clear that the landlord’s breach of such warranty may be directly relevant to the issue of possession. If the tenant can prove such a breach by the landlord, he may demonstrate that his nonpayment of rent was justified and that no rent is in fact “due and owing” to the landlord. Under such circumstances, of course, the landlord would not be entitled to possession of the premises. (See
Skaggs
v.
Emerson
(1875)
*636
The landlord contends, however, that the recognition of such a defense will completely undermine the speedy procedure contemplated for unlawful detainer actions. In the first place, however, while the state does have a significant interest in preserving a speedy repossession remedy, that interest cannot justify the exclusion of matters which are essential to a just resolution of the question of possession at issue. As the Court of Appeal observed in
Abstract Investment Co.
v.
Hutchinson
(1962)
Second, we believe the landlord’s contention greatly exaggerates the detrimental effect of the recognition of this defense on the summary unlawful detainer procedure. As illustrated by the numerous California precedents cited and discussed above (see fn. 19), defendants in unlawful detainer actions have long been permitted to raise those affirmative defenses —both legal and equitable—that are directly relevant to the issue of possession; over the years, the unlawful detainer action has remained an efficient, summary procedure. We see no reason why the availability of a warranty of habitability defense should frustrate the summary procedure when the availability of these other defenses has not.
Indeed, the landlord’s dire forecast fades in the light of the host of recent out-of-state decisions which, in adopting a warranty of habitability, have explicitly permitted the issue to be raised in summary dispossession proceedings. (See p. 631,
ante.)
In addition, several “model” landlord-tenant codes, recently drafted under the auspices of highly regarded legal bodies, have also recommended the recognition of this defense in such summary actions. (See National Conference of Commissioners on Uniform State Laws, Uniform. Residential Landlord-Tenant Act (1972) § 4.105; American Bar Foundation, Model Residential Landlord-Tenant Code (Tent. Draft 1970) §§ 2-203(1), 3-210.) As these authorities recognize, this development accords with “[t]he salutary trend toward determination of the rights and liabilities of litigants in one, rather than multiple proceedings . . . .”
(Jack Spring, Inc.
v.
Little (1972)
Moreover, as the
Hinson
court indicated, sound procedural safeguards suffice to protect the landlord’s economic interests without depriving the tenant of a meaningful opportunity to raise the breach of warranty issue. The
Hinson
court, elaborating on a procedural mechanism suggested by the Court
of
Appeal for the District of Columbia in the
Javins
opinion (428
*637
F.2d at p. 1083, fn. 67), stated: “If the tenant claims that all or a part of rent is not due because of defects in the premises, the trial court may, during the pendency of the action and at the request of either party, require the tenant to make the rental payments at the contract rate into court as they become due for as long as the tenant remains in possession. At the trial of the action the court can then determine how the rent paid into court should be distributed.” (
4. Conclusion.
We have concluded that a warranty of habitability is implied by law in residential leases in this state and that the breach of such a warranty may be raised as a defense in an unlawful detainer action. Under the implied warranty which we recognize, a residential landlord covenants that premises he leases for living quarters will be maintained in a habitable state for the duration of the lease. This implied warranty of habitability does not require that a landlord ensure that leased premises are in perfect, aesthetically pleasing condition, but it does mean that “bare living requirements” must be maintained.
22
In most cases substantial compliance with those applicable building and housing code standards which materially affect health and safety will suffice to meet the landlord’s obligations under the common law implied warranty of habitability we now recognize.
23
As the
Hinson
court
*638
observed: “[m]inor housing code violations standing alone which do not affect habitability must be considered
de minimus
and will not entitle the tenant to reduction in rent -. . . .” (
In the instant case, the tenant defended the unlawful detainer action on the grounds that the premises were not in a habitable condition; in support of this claim, as noted above, he presented a city housing inspection report detailing some 80 violations of local housing and building codes, including major defects in the building’s plumbing and electrical facilities. At trial the tenant also testified that he had repeatedly informed the landlord of plumbing blockages, a collapsed bathroom ceiling, lack of heat in four rooms, exposed and faulty wiring and an illegally installed and dangerous stove, but that the landlord had failed to make any repairs within a reasonable period of time. Although this evidence of substantial defects in the premises was not controverted at trial, the court granted judgment for the landlord, on the theory that, whatever the condition of the premises, the tenant’s exclusive remedy was provided by section 1941 et seq. of the Civil Code. As discussed above, that conclusion was erroneous and thus we must remand this case to the trial court so that it may determine whether the landlord has breached the implied warranty of habitability as defined in this opinion.
If the trial court does find a breach of implied warranty, the court must then determine the extent of the damages flowing from this breach. Recent decisions have suggested that in these circumstances the “tenant’s damages shall be measured by the difference between the fair rental value of the premises if they had been as warranted and the fair rental value of the premises as they were during occupancy by the tenant in the unsafe or unsanitary condition.”
(Mease
v.
Fox
(Iowa 1972)
We recognize that the ascertainment of appropriate damages in such cases will often be a difficult task, not susceptible of precise determination, but in this respect these cases do not differ significantly from a host of analogous situations, in both contract and tort law, in which damages cannot be computed with complete certainty. (See, e.g.,
Shoemaker
v.
Acker
(1897)
In the instant case, the tenant has already quit the premises and thus the only matter to be determined on remand is the question of money damages owing to the landlord. In unlawful detainer actions generally, however, if the trial court determines that the landlord’s breach of warranty is total, and that the tenant owes no rent whatsoever, the court should, of course, enter judgment for the tenant in the unlawful detainer action. If the court determines, however, that the damages from the breach of warranty justify only a partial reduction in rent, the tenant may maintain possession of the premises only if he pays that portion of the back tent that is owing, as directed by the trial court. (See Code Civ. Proc., § 1174; cf.
Academy Spires, Inc.
v.
Brown
(1970)
In summary, we have concluded that the traditional common law rule which imposed no warranty of habitability in residential leases is a product of an earlier, land-oriented era, which bears no reasonable relation to the social or legal realities of the landlord-tenant relationship of today. The United States Supreme Court has observed that “the body of private property law . . ., more than almost any other branch of law, has been shaped by distinctions whose validity is largely historical.”
(Jones
v.
United States
*640
(1960)
Let a peremptory writ of mandate issue directing the superior court to vacate the San Francisco Superior Court judgment entered in the case of Sumski v. Green, S.C.A. No. 11836 on January 3, 1973, and instructing the court to proceed with the trial of the unlawful detainer action in accordance with the views expressed herein.
Wright, C. J., McComb, J., Mosk, J., Burke, J., Sullivan, J., and Clark, J., concurred.
Notes
See
Pines
v.
Perssion
(1961)
Hall
v.
Municipal Court,
S.F. 22992, also decided this day,
post,
p. 641 [
The instant record contains no allegations—by either the landlord or tenant—that the premises were in an uninhabitable condition at the time they were first rented by petitioner. Consequently we have no occasion in the instant case to pass on the question of whether a lease of such premises constitutes an “illegal contract” (see
Shephard
v.
Lerner
(1960)
The superior court judgment states: “The court finds that defendant has not complied with sec. 1941 Civil Code et seq. and is not entitled to relief or withholding of rent by reason of such failure to comply.”
The propriety of relief by writ of mandate under these circumstances was recognized in
Schweiger
v.
Superior Court
(1970)
Petitioner Green failed to make the requisite payments of rent into court, but instead quit the premises, allegedly because of continued deterioration of the dwelling; thus, our stay of execution is no longer in force. The landlord claims that this development has rendered the case moot, and he urges that the action be dismissed. Petitioner has properly pointed out, however, that the trial court judgment of $225 is still outstanding against him. Inasmuch as this outstanding adverse money judgment was rendered without consideration of the effects of a possible breach of an implied warranty of habitability, the present controversy is not moot.
Moreover, because of the general importance of the underlying warranty of habitability issue and the frequency with which this issue will arise, we believe that in any event we should resolve the question in the instant case. As we stated recently in
Liberty Mut. Ins. Co.
v.
Fales
(1973)
The list of recent law review articles on this subject, uniformly advocating the adoption of an implied warranty of habitability as a more realistic approach to contemporary conditions, is virtually endless. (E.g., Lesar, Landlord and Tenant Reform (1969) 35 N.Y.U.L.Rev. 1279; Quinn & Phillips, The Law of Landlord-Tenant: A Critical Evaluation of the Past With Guidelines for the Future (1969) 38 Fordham L.Rev. 225; Schoskinski, Remedies of the Indigent Tenant: Proposal for Change (1966) 54 Geo.L.J. 519; Loeb, Low Income Tenants in California: A Study in Frustration (1970) 21 Hastings LJ. 287; Moskovitz, Rent Withholding and the Implied Warranty of Habitability (1970) 4 Clearinghouse Rev. 49; Note, Repairing the Duty to Repair (1971) 11 Santa Clara Law. 298.)
Section 33250 of the Health and Safety Code, enacted in 1970, documents this condition in California. The section states: “[The Legislature] finds and declares that there continues to exist throughout the state a seriously inadequate supply of safe and sanitary dwelling accommodations for persons and families of low income. This condition is contrary to the public interest and threatens the health, safety, welfare, comfort and security of the people of this state.”
In light of this inequality of bargaining power, the Massachusetts Supreme Judicial Court, in recently recognizing a warranty of habitability for residential leases, held that such warranty generally could not be waived by any provision in the lease or rental agreement. (See
Boston Housing Authority
v.
Hemingway
(1973) -Mass. - [
Thus, for example, the doctrine of “constructive eviction,” which expanded the traditional “covenant of quiet enjoyment” from simply a guarantee of the tenant’s possession of the premises (see
Connor
v.
Bernheimer
(N.Y. Com. Pleas 1875)
Indeed, even before the turn of the century, common law courts had recognized an implied warranty of habitability in leases of furnished rooms or furnished houses. In the seminal case of
Ingalls
v.
Hobbs
(1892)
Recent cases have recognized that the rationale underlying the
Ingalls
court’s adoption of an implied warranty of habitability in the rental of furnished dwellings is now applicable to urban residential leases generally. (See, e.g.,
Boston Housing Authority
v.
Hemingway
(1973) - Mass. - [
*628
National Realty Corporation
(1970)
The cases are cited in fn. 1,
supra.
Moreover, lower courts in several additional states have also recently recognized the existence of an implied warranty of habitability. (See, e.g.,
Amanuensis Ltd.
v.
Brown
(1971)
The Hinson decision was decided prior to the Illinois, Iowa, and Massachusetts decisions cited in footnote 1, but subsequent to all the other out-of-state authority.
Two of the recent decisions of our sister states have reached similar conclusions under comparable circumstances. In
Jack Spring, Inc.
v.
Little
(1972)
In the recent case of
Academy Spires, Inc.
v.
Brown
(1970)
Section 1170 of the Code of Civil Procedure provides that in summary unlawful detainer proceedings “the defendant may appear and answer or demur” (italics added), and under section 431.30, an “answer” may contain “[a] statement of any new matter constituting a defense” but may not claim affirmative relief. Thus, nothing in the statutory scheme precludes a defendant from interposing an affirmative defense in an unlawful detainer proceeding.
See, e.g.,
Arnold
v.
Krigbaum
(1915)
An exception to this rule has been recognized when the tenant has voluntarily surrendered possession of the premises before the trial of the unlawful detainer action. (See, e.g.,
Servais
v.
Klein
(1931)
Although several Court of Appeal decisions have suggested that the
Knowles
doctrine precludes the introduction of
all
affirmative defenses in unlawful detainer actions except for “equitable” defenses (see,
e.g., Union Oil Co.
v.
Chandler
(1970)
Two cases aptly illustrate the first proposition. In
Smith
v.
Whyers
(1923)
Moreover, the
Johnson
case also demonstrates that the rule permitting defenses that are relevant to the issue of possession is not limited to “equitable” defenses, but applies equally to “legal” defenses. In permitting the' tenant to set up the defenses of fraud under the circumstances discussed above, the
Johnson
court specifically noted that such defense “wherever set up,
is of legal and not of merely equitable cognizance
. . . .” (Italics added.)
(Johnson
v.
Chely
(1872)
Two of the more recent unlawful detainer cases,
Abstract Investment Co.
v.
Hutchinson
(1962)
In Schweiger, following the lead of Abstract Investment, we upheld a tenant’s defense to an unlawful detainer action on the ground that the landlord’s attempt to evict a tenant was in retaliation for his exercise of his right to “repair and deduct” granted by Civil Code section 1941 et seq. Without specifically labelling this defense as “legal” or “equitable,” our court recognized that to prevent the emasculation of the “repair and deduct” remedy, we were compelled to permit such a defense in an unlawful detainer action. (3 Cal.3d at pp. 513-517.)
The traditional “independent covenant” rule only applied to covenants, such as the covenant to repair buildings, which were “collateral” to the landlord’s obligation to provide land to the tenant; because of the importance of land in early leases, the common law generally recognized that the tenant’s obligation to pay rent was mu
*635
tually dependent upon the landlord’s fulfillment of his covenant to furnish the land. Thus, if the landlord deeded away even a small portion of the leased land, the common law considered this a “partial actual eviction” and relieved the tenant of his rental obligation. (See
Giraud
v.
Milovich
(1938)
Our rejection of the “independent covenant” rule in this context was foreshadowed by the Court of Appeal decision in
Groh
v.
Kover’s Bull Pen, Inc.
(1963)
The recent case of
Academy Spires, Inc.
v.
Brown
(1970) 111 N.J.Super.
All
[
We also believe that the standards of “tenantability” set out in Civil Code section 1941.1, though not strictly applicable in this context of their own force, may *638 provide some helpful guidance in determining whether a landlord has satisfied the common law warranty of habitability.
The case of
Academy Spires, Inc.
v.
Brown
(1970)
