
2 Cal.2d 221 (1934)
BLANCHE C. MARKHAM, as Executrix, etc., Appellant,
v.
ALLAN FRALICK et al., Respondents.
L. A. No. 14551. 
Supreme Court of California. In Bank.  
December 29, 1934.
 Harlan G. Palmer and Charles D. Thompson for Appellant.
 Roger Marchetti and A. V. Falcone for Respondents.
 CURTIS, J.
 This action is one in unlawful detainer. The property in controversy was under a ninety-nine year lease. The lessees, the defendants and respondents in this action, were in default in the payment of some $30,000 rent besides taxes which they had agreed to pay. The leased premises were a city block in Hollywood on which were located some fifteen dwellings or bungalows occupied by ten or twelve subtenants. The defendants were in possession of the property only through their subtenants. Their agent collected the rents and paid them to his principals, the defendants. While the defendants were in default in the payment of said rent and taxes, the plaintiff, the owner of said property, served written notice on the defendants to pay the rent and taxes due and unpaid, or quit and surrender the property to the plaintiff within three days after the service of said notice. No such notice, nor any notice whatever, was ever served by plaintiff on any of the subtenants. Within three days after the service of said notice, the defendants served written notice upon the plaintiff and her attorney of their surrender of the premises to the plaintiff as demanded by the notice served upon the defendants. They also notified their agent not to collect any further rent from said subtenants, and their said agent also notified said subtenants and the plaintiff that he was no longer the agent of the defendants and had no authority to act as the agent of the defendants or either of them in respect to said property. *223
 Thereafter the plaintiff instituted this action in unlawful detainer against the defendants to recover possession of said premises and the rent and taxes due under the terms of said lease. There is no dispute as to the facts related above. The defendants, as an affirmative defense to said action, alleged their surrender of the possession of said premises to the plaintiff within three days after the service upon them of plaintiff's demand that they pay said rent and taxes or surrender and quit said premises. The court found in accordance with this affirmative defense of the defendants, and rendered judgment in their favor that the plaintiff take nothing by said action. The plaintiff has appealed from this judgment.
 [1] In asking for a reversal of the judgment, the appellant first contends that the lessees, the defendants and respondents herein, were guilty of unlawful detainer after notice to quit when the subtenants of the lessees, who were not served with notice to quit, continued to occupy said property after the lessees, in response to plaintiff's demand either to pay the rent due or surrender possession, served notice on the landlord that they surrendered possession of said premises in compliance with said demand. Section 1161 of the Code of Civil Procedure, defining who are guilty of unlawful detainer, might seem to indicate that notice must be served upon the subtenants as well as upon the tenant before the landlord could maintain an action against the tenant for unlawful detainer. This section was construed in conjunction with section 1164 of the same code in the case of Tujague v. Superior Court, 69 Cal.App. 35, 39 [230 P. 198], and Telegraph Avenue Corp. v. Raentsch, 205 Cal. 93, 98 [269 P. 1109, 61 A.L.R. 366]. These cases hold that where the premises are occupied by the tenant and also subtenants, and the tenant is delinquent in his rent and has been served with notice to pay or surrender possession of the premises, that an action in unlawful detainer will lie at the instance of the landlord against the tenant, without service of any notice to quit on any of the subtenants. But in each of these actions, the delinquent tenant was in possession of the premises in conjunction with his subtenants, and had made no effort to comply with the demand of the landlord that he pay the rent due, or surrender up the premises. In the instant action, the evidence shows that the defendants had *224 surrendered their individual possession of the premises to the plaintiff within three days after the service of the notice to pay rent or quit. They notified the plaintiff in compliance with her demand for the rent or for the surrender of the premises, that they surrendered to her the possession of the premises; they notified their agent to collect no more rent from the subtenants; and also notified the subtenants that neither they nor their agent would collect any rent in the future. We think it is apparent from the evidence that defendants did all within their power to comply with plaintiff's demand for the surrender of said premises, except to oust their subtenants and turn over to the plaintiff the premises in an absolutely vacant and tenantless condition. Plaintiff had it in her power to compel the defendants to free said premises of the possession of said subtenants before defendants' surrender of said premises would be complete. She neglected to exercise this right by declining to serve notice to quit upon the subtenants. The evidence shows that this refusal was designedly done and that her intent and purpose was that said subtenants should continue to occupy said premises as the tenants of the plaintiff. This was clearly shown by the statement of her attorney made in open court at the trial of this action in which he said: "We did not wish to serve these subtenants with the notice to pay $30,000 in rent and frighten them to death and drive them all pell mell from the premises with the three-days notice to quit." The attorney making this concession, not only represented the plaintiff in this action and in all proceedings in this matter leading up to the filing of the complaint herein, but as the attorney for the plaintiff actually signed the three days' notice to quit which was served upon the defendants. He therefore was fully advised of the reason why said notice was not served upon the subtenants and intentionally refrained from serving the subtenants for the reason that he wanted them to continue to occupy the property. It is apparent from the foregoing facts, that the plaintiff waived her right to the possession of said premises in so far as said subtenants were concerned, by expressly refraining from notifying them to quit the possession of said premises and thereby accepted them as her tenants. Having accepted said subtenants as her own tenants, she cannot thereafter complain of their occupancy *225 of the premises and successfully contend that their possession of the premises was the possession of the defendants. [2] She waived any right to object to their occupancy of the property, and as the defendants surrendered the possession of said premises, subject only to the possession of these subtenants, they did all that was required of them to put the plaintiff in possession and to divest themselves of such possession. As the defendants were not in the possession of said premises at the date of the commencement of said action, they were not guilty of unlawful detainer. An action, therefore, in unlawful detainer will not lie.
 [3] Plaintiff makes the further contention that she was entitled to a judgment against the defendants for the rent and taxes due under the lease at the commencement of the action, notwithstanding the action in unlawful detainer would not lie in her favor. In other words, the plaintiff claims that in this action for unlawful detainer, even if such action for the recovery of the leased premises must fail because the defendants had surrendered possession thereof prior to the commencement of said action, nevertheless, she is entitled to prosecute said action for the recovery of the rent and taxes due under the lease. The only authority cited in support of her position is the case of Zellner v. Wassman, 184 Cal. 80, 88 [193 P. 84, 87], which holds that, "Provided the facts stated show some right of recovery ... a party cannot be thrown out of court merely because he may have misconceived the form of relief to which he is entitled." This is undoubtedly the general rule applicable to most cases. It is contended by respondents that the rule is different in certain statutory actions and that an action in unlawful detainer is one to which the general rule stated above does not apply. The only California case to which our attention has been called directly bearing upon this question is the case of Chase v. Peters, 37 Cal.App. 358, 360 [174 P. 116, 118]. In that case, an action in unlawful detainer was brought by the lessor against the lessee and the assignee of the latter for the recovery of the leased premises and for rent and taxes due under the lease. Judgment was rendered in favor of the plaintiff as prayed for against both the lessee and his assignee. The judgment against the lessee was reversed on *226 the ground that the lessee was not in possession of the property at the commencement of the action, he having transferred the possession of the property to his assignee some time prior to the commencement of the action. It was insisted in that action that, as the lessee under the terms of the lease was liable for the payment of the rent even after he had assigned the lease, a judgment against him for the rent due was proper; but the court held otherwise. In its decision, the court traced the object and purpose of the action of unlawful detainer as follows: "The summary proceeding provided for the obtaining of possession of real property is special and must be restricted in its use to the particular purposes expressed in the sections of the code embraced within chapter IV, title III, of the Code of Civil Procedure. The mode and measure of the plaintiff's recovery are therein limited. The law on this subject has been construed with strictness, for the relief authorized in some particulars is penal in its nature. The defendant is brought into court to answer within three days after issuance of summons (sec. 1167); amendments to the complaint are provided to be made without terms (sec. 1173); in the judgment the rents found to be due and damages may be trebled (sec. 1174). Other provisions designed to hasten the recovery of possession of the property as the main relief are included, which are different from those affecting civil actions generally. A cross-complaint or counterclaim is not allowed. (Arnold v. Krigbaum, 169 Cal. 143 [Ann. Cas. 1916D, 370, 146 P. 423].) Rents accrued at the time of the commencement of the action are allowed to be recovered only because the statute so provides (sec. 1174). These rents are added to the damages for the unlawful detention." Continuing the court in that opinion further said (p. 361): "We have presented then the view, illustrated, as we think, both by a consideration of the terms of the statute and the decisions, that the summary proceeding authorized by the code and here adopted by the plaintiff is one which is, as to its prosecution and remedy, within the scope of its application, exclusive and limited. The statute does not authorize the recovery of any money the right to which accrued before the unlawful detention began, except arrears of rents. And this recovery can only be had against the person guilty of such detention, for the main thing sought is the possession *227 of the property. (Arnold v. Krigbaum, supra.)" In that case, this court denied a petition for a hearing therein. In our opinion, that decision correctly interprets the law relative to actions for unlawful detainer. To permit recovery for rent and taxes in an action of unlawful detainer after the landlord has failed to show that the tenant unlawfully detained possession of the property would often work a distinct hardship on the tenants. In the first place, he is haled into court in a summary proceeding in which there is denied to him certain procedural rights enjoyed by litigants in ordinary actions. He is denied the substantive right to file a cross-complaint or counterclaim in the action, and possibly he might be subjected to treble damages. (Sec. 1174, Code Civ. Proc.) The primary purpose of such an action is for the recovery of the possession of the property. The recovery of rent is a mere incident to the main object. (Arnold v. Krigbaum, 169 Cal. 143, 146 [146 P. 423, Ann. Cas. 1916D, 370].) When the main object of the action fails, the incidents fall with it. (Chase v. Peters, supra.)
 Upon the two propositions advanced by the appellant, the trial court reached a different conclusion than that contended for by her. In our opinion, the trial court correctly determined the questions presented.
 The judgment is affirmed.
 Shenk, J., Langdon, J., Preston, J., Waste, C.J., and Seawell, J., concurred.
