
20 Cal.2d 779 (1942)
CHARLES R. KENT et al., Respondents,
v.
ALVERDA CLARK, Appellant.
L. A. No. 17845. 
Supreme Court of California. In Bank.  
Sept. 11, 1942.
 Lorrin Andrews and Wm. J. Clark for Appellant.
 Emil H. Koehl for Respondents.
 EDMONDS, J.
 The question presented for decision by this appeal is whether, in an action of ejectment brought by a vendor of realty against a vendee in default under an executory contract of sale, the vendee may set up fraud in the inception of the contract, either by way of defense to the action or by way of cross-complaint for rescission or damages. The trial court answered it in the negative and rendered judgment for the respondents, who are the vendors of the property in controversy.
 The appellant entered into a written contract with the respondents under which she agreed to purchase a house and lot for the sum of $4,500, of which amount $200 was paid in cash. She agreed to pay the balance in stated instalments, with interest, and also to pay the taxes upon the property. Time was of the essence of the agreement. Although not provided for by the contract, she was given possession of the property.
 Three years passed, during which the appellant made all payments required by the contract with the exception of certain taxes. Although these payments were not promptly made, the vendors accepted them. But upon the appellant's failure to pay an instalment which accrued in August, 1939, the respondents demanded, in writing, that she remedy the default immediately. Although there is some dispute as to *781 the amount which was due at that time, the appellant admits that she was then in default so far as the payment of taxes is concerned.
 A week later the respondents wrote another letter informing the appellant that unless the delinquent taxes and the balance of the instalment of principal then overdue were paid within three days, a forfeiture would be declared. The day after this letter was written, the appellant served upon the vendors a written refusal to make further payments and a notice of rescission of the contract, offering to restore to them the property upon condition that they return to her all money paid under the agreement, less the reasonable value of the use of the property. One month later, the vendors served a notice advising the appellant that her rights under the contract were thereby declared forfeited and demanding possession of the property. She made no further effort to remedy her default and refused to comply with the demand for surrender of possession. The present action followed.
 The complaint alleges the making of the contract, the default thereunder, the vendee's attempted repudiation and rescission, and her refusal to surrender possession after demand. These facts state a cause of action in ejectment upon which the vendors sought no further relief than possession of the property. To this complaint the appellant filed an answer, admitting execution of the agreement, her possession and default thereunder. By way of an affirmative defense, she alleged that the respondents demanded of her more than was due to them, that she was not given a reasonable time in which to remedy her default, and that she was induced to enter into the contract through the false and fraudulent representations of the vendors.
 These asserted representations, all of which concern the nature, character and value of the property, are set forth with particularity. The answer also contains an allegation of the appellant's notice of rescission of the contract, her offer of restoration of the property to the respondents upon the condition that they return to her all money paid under the contract less the reasonable value of the use of the premises, and the refusal of the respondents to comply with this demand.
 In a cross-complaint, the appellant alleged the same representations, the fact that she had given notice of rescission, *782 and the refusal of respondents to accept her conditional offer of restoration of the property. Under this pleading she prayed for a decree declaring the contract to be rescinded and for a judgment in the sum of $2,219.72, representing the amount paid by her under the contract, together with the reasonable value of the improvements placed upon the property by her, less the value of its use during her occupancy.
 At the trial of the case upon these pleadings, when the respondents had concluded the presentation of evidence, the appellant moved for a nonsuit upon the ground that she was not in default in the sum demanded by them and also that she had not been given a reasonable time in which to remedy her default. This motion was denied. She then proceeded with the presentation of her defense and offered evidence tending to prove fraud in the inception of the contract, as alleged in her answer and cross-complaint. The respondents objected to this evidence upon the ground that the alleged fraud was neither a proper subject of defense nor cross-complaint to an action in ejectment where possession only was demanded. The court sustained this objection. The appellant then made an offer of proof, to which the respondents interposed the same objection with the same ruling.
 Thereafter the court gave judgment for the respondents, based upon findings that the appellant had repudiated, and was in default under the contract of sale; that the contract was not terminated by mutual consent; that the appellant had at all times since her default refused to make further payments under the agreement; that the respondents, as vendors, were entitled to possession of the property, but that the appellant was entitled to a reasonable time in which to remedy her default. The judgment fixed this time as not exceeding 60 days from its entry.
 The appellant asserts that the ruling of the trial court in sustaining objections to evidence in support of her allegations of fraud was erroneous, and that the court also erred in failing to make findings of fact upon that issue. She also contends that it was an abuse of discretion to deny her motion for a new trial. The respondents rest their case upon the proposition that in an action of ejectment, the defendant may not set up fraud in the inception of the contract under which he took and held possession either by way of answer or cross-complaint. More specifically, they rely upon the principle, frequently announced in the authorities, to *783 the effect that where a vendee in possession under an executory contract of purchase has failed to perform his part of the contract and is in default with respect thereto without excuse, he may not maintain an equitable defense to an action of ejectment by the vendor.
 [1] Two distinct remedies are open to a vendee who has been induced to enter into the contract of purchase by the fraudulent representations of his vendor. Notwithstanding the vendor's fraud, he may elect to affirm the contract, retain the property received under it and sue the vendor for damages in an action for deceit. Having chosen that course upon the discovery of the vendor's fraud, the vendee need not continue performance but may properly withhold payments under the contract in an amount necessary to recoup the damages which he has suffered. In other words, because of the vendor's fraud, he may avoid the obligation stated by the contract and excuse what would otherwise be a default. (Field v. Austin, 131 Cal. 379 [63 P. 692]; Paolini v. Sulprizio, 201 Cal. 683 [258 P. 380]; Pembrook v. Houston, 41 Cal.App. 54 [181 P. 828]; Palladine v. Imperial Valley F. L. Assn., 65 Cal.App. 727 [225 P. 291]; 25 Cal.Jur. 560.)
 [2] In such a situation, as the vendee's failure to make payments is excused, he may set up the seller's fraud as a defense to an action for the balance due under the contract, by way of answer to the whole demand, or in abatement of the damages, according to the circumstances of the case. (Toby v. Oregon Pac. R. R. Co., 98 Cal. 490 [33 P. 550]; Field v. Austin, supra; Hunter v. McKenzie, 197 Cal. 176 [239 P. 1090]; Paolini v. Sulprizio, supra; Pembrook v. Houston, supra; Palladine v. Imperial Valley F. L. Assn., supra.) And, for the same reason, the fraud of the vendor may be pleaded as a defense in an action by the vendor to have the contract canceled, to quiet title to the property, and for possession of the premises. The reason for this rule was stated in Nevada Land & Inv. Corp. v. Sistrunk, 220 Cal. 174 [30 P.2d 389], where the court declared: "There would be little consistency or justice in a rule which, when the suit was for the payments due under the contract, would allow the buyer to set up damage caused by the fraud of the seller in answer to the demand or in abatement of damages, but, when the action was one for possession of the premises and to quiet title, would not allow the same matter to be *784 pleaded as a defense against forfeiture for failure to make the payments which the law says he may withhold."
 [3] But the defrauded vendee has another and alternative remedy. He may elect to rescind the contract for fraud, restore possession to the vendor, and recover the purchase money paid less the fair rental value for the use of the property during his occupancy. This right of rescission is available to a vendee in default. (Graham v. Los Angeles First N. T. & S. Bank, 3 Cal.2d 37 [43 P.2d 543]; Lombardi v. Sinanides, 71 Cal.App. 272 [235 P. 455].)
 However, by certain decisions it has been broadly and unqualifiedly held that a vendee who has elected to disaffirm the contract for fraud, may not thereafter remain in possession of the property and defend against an action in ejectment brought by the vendor. Having taken possession by virtue of the contract, it is said, the vendee may retain that possession only by faithfully performing the conditions of the contract under which he entered, and if he desires to rescind, he may do so only by a surrender of the premises to the vendor. To hold otherwise, according to this reasoning, would allow the vendee to assume the inconsistent position of repudiating the contract and at the same time claiming under it. This analysis of the legal principles involved, at least as applied to the facts of the present case, may not be legally or logically sustained.
 True, a defrauded vendee desiring to rescind his contract "must restore to the other party everything of value which he has received from him under the contract; or must offer to restore the same, upon condition that such party shall do likewise, unless the latter is unable or positively refuses to do so." ( 1691 (2), Civ. Code.) But under the express terms of this code section actual surrender of the property by the vendee seeking rescission is not a prerequisite to a suit if he has offered to restore the property to the vendor. (McCall v. Superior Court, 1 Cal.2d 527 [36 P.2d 642, 95 A.L.R. 1019]; Lanktree v. Spring Mountain Acres, 213 Cal. 362 [2 P.2d 338]; O'Meara v. Haiden, 204 Cal. 354 [268 P. 334, 60 A.L.R. 1381]; Isom v. Rex Crude Oil Co., 147 Cal. 659, 662 [82 P. 317]; Westerfeld v. New York Life Ins. Co., 129 Cal. 68 [58 P. 92, 61 P. 667]; Rohrbacher v. Kleebauer, 119 Cal. 260 [51 P. 341]; Estate of McNutt, 36 Cal.App.2d 542 [98 P.2d 253]; Shaffer v. Security T. & S. Bank, 4 Cal.App.2d 707 [41 P.2d *785 948]; Cameron v. Evans Securities Corp., 119 Cal.App. 164 [6 P.2d 272]; Moore v. Giffen, 110 Cal.App. 659 [294 P. 730]; Appliance Co. v. Kelley, 102 Cal.App. 67 [282 P. 518]; Murdock v. Fisher Finance Corp., 79 Cal.App. 787 [251 P. 319]; California Credit etc. Corp. v. Goodin, 76 Cal.App. 785 [246 P. 121]; Simmons v. Briggs, 69 Cal.App. 447 [231 P. 604]; Haserot v. Keller, 67 Cal.App. 659 [228 P. 383]; Norton v. Rosenkranz, 62 Cal.App. 226 [216 P. 380]; Bellone v. Kleinau, 54 Cal.App. 428 [201 P. 977].) And the statute declares that the offer to surrender possession of property received under the contract need not be unqualified but may be made conditional upon the vendor's restitution of the purchase money. (Accord: Rest., Contracts,  480 (3); 349 (3).)
 [4] Applying the statutory rule to the facts of the present case, the appellant, upon discovery of the respondents' alleged fraud, served notice of rescission and offered to restore possession of the property to them upon condition that they return to her all money paid by her under the contract, less the reasonable rental value of the premises. If the respondents are guilty of the asserted fraud, this notice and offer established the right of the appellant to avoid the transaction, and as a result of their refusal to comply with her demand, she had the right to retain possession of the property until such restitution was effected and assert that right by pleading and proving the facts establishing the fraud. She does not question the vendor's title to the property, and, in fact, she has offered to restore possession of it. In effect, therefore, by her pleading she has agreed to treat the action as an acceptance of her offer. But she demands, as an incident to her right to rescind, that possession be given the vendor concurrently with his restoration to her of the purchase money. Under these circumstances, if, upon trial, the vendee proves that the vendor is guilty of fraud justifying a rescission of the contract, the court should render its judgment that the vendor is entitled to possession of the property in controversy upon payment of the amount he has received, together with the value of any improvements which the vendee has placed upon the land (Barrows v. Harter, 165 Cal. 45 [130 P. 1050]; Worley v. Nethercott, 91 Cal. 512 [27 P. 767, 25 Am.St.Rep. 209]; Gates v. McLean, 70 Cal. 42 [11 P. 489]), less the reasonable rental value of the vendee's *786 occupancy. (See Rest., Contracts,  481, 354.) The ruling which foreclosed the appellant from introducing any evidence tending to prove fraud as a conditional defense to the action is directly contrary to the principles which have been stated and requires a reversal of the judgment.
 Insofar as the case of Los Molinos Land Co. v. MacKay, 175 Cal. 305 [165 P. 926], is contrary to these conclusions, it is overruled and Watkins v. Warren, 122 Cal.App. 617 [10 P.2d 500], and Hincksman v. Delacour, 47 Cal.App. 416 [190 P. 832], are disapproved.
 [5] The facts relied upon by the appellant also furnish a proper basis for her cross-complaint. Section 442 of the Code of Civil Procedure provides: "Whenever the defendant seeks affirmative relief against any party, relating to or depending upon the contract, transaction, matter, happening or accident upon which the action is brought, or affecting the property to which the action relates, he may, in addition to his answer, file at the same time ... a cross-complaint. ..." The more recent cases have approved a broad and liberal interpretation of the phrase "transaction upon which the action is brought." (Hanes v. Coffee, 212 Cal. 777 [300 P. 963]; California Trust Co. v. Cohn, 214 Cal. 619, 622 [7 P.2d 297]; Nevada Land & Inv. Corp. v. Sistrunk, supra.) The facts surrounding the cause of action and not the form of the complaint are determinative of what constitutes the "transaction." If the defendant's pleading sets forth matter inextricably related to the matter forming the basis of the plaintiff's complaint, it meets the statutory requirements of a cross-complaint, and it is immaterial that the relief sought thereby is independent of that prayed for in the complaint.
 [6] Tested by these principles, it is clear that the alleged fraud of the respondents arose out of the identical transaction which is the basis of their cause of action in ejectment. They demand possession of the property because of the appellant's breach of contract. She charges fraud in inducing the execution of that contract. Were it not for the contract, therefore, neither party would have had occasion to bring suit.
 The judgment is reversed.
 Gibson, C.J., Shenk, J., Curtis, J., Carter, J., Traynor, J., and Peters, J. pro tem., concurred.
