
69 Cal.App.2d 589 (1945)
MABEL ATEN, Appellant,
v.
IRA D. ATEN, Respondent.
Civ. No. 3366. 
California Court of Appeals. Fourth Dist.  
June 13, 1945.
 Paul G. Henderson and Walter H. Sprague for Appellant.
 Harry W. Horton for Respondent.
 BARNARD, P. J.
 On May 16, 1935, the parties hereto, who were husband and wife, entered into a written property settlement agreement by the terms of which each was given certain property and the defendant agreed to pay to the plaintiff $100 a month during her lifetime, or until her remarriage.
 On August 1, 1942, the plaintiff wife brought this action to cancel and set aside this agreement on the ground that her signature thereto had been obtained through fraudulent representations made by the defendant, and seeking a restoration of her interest in certain described community property. Second and third counts of the complaint added failure of consideration and declaratory relief as causes of action. The defendant filed an answer and cross-complaint pleading a denial, the statute of limitations and estoppel and alleging, among other things, that he had fully performed the terms *590 of the agreement and for eight years had conducted his business in reliance thereon, that the plaintiff had for years accepted the monthly payments and had ratified the contract, and that he was the sole owner of the property involved. The prayer was that the plaintiff take nothing by her complaint; that it be decreed that the property settlement agreement is valid and binding between the parties; that it be decreed that the plaintiff had no right, title or interest in or to any of the properties of the defendant, real or personal, and no property rights as to him other than as set forth in that contract; and for general relief. The plaintiff answered this cross-complaint.
 The trial of the action was set for September 13, 1943, and was continued to January 10, 1944. At that time counsel for the plaintiff moved for a further continuance. When this motion was denied counsel attempted to dismiss the action and objected to the court's proceeding with it, but asked for findings in the event judgment was to be entered. The court overruled this objection. Subsequently, findings were made and a judgment entered, and this appeal followed.
 [1] The appellant's sole contention is that no affirmative relief, within the meaning of paragraph 1 of section 581 of the Code of Civil Procedure, was sought in the answer or cross-complaint and that it was, therefore, the duty of the trial court to dismiss the action in response to her request. She relies upon a number of cases involving the sufficiency of counterclaims and other early cases in which it was held that a cross-complaint was unnecessary in a quiet title action since a judgment entered upon issues raised by the answer, if in favor of the defendant, would operate as an estoppel and protect him as well as a decree in his favor upon a cross-complaint. It is argued that the respondent could not have maintained an action against the appellant, that there was no controversy between them until the appellant raised the issue of the validity of the agreement by bringing this action, that the respondent asked for nothing either in his answer or cross-complaint which he would not have received upon a denial of relief to the appellant, and that it follows that no affirmative relief was here asked for by the respondent, within the meaning of the statute.
 In Islais etc. Water Co. v. Allen, 132 Cal. 432 [64 P. 713], most of the cases relied upon by the appellant are discussed and cogent reasons are given why the assertion of property *591 rights, even when made in an answer, may constitute the seeking of affirmative relief within the meaning of the code section. In that case, the court said:
 "The code plainly provides that the plaintiff cannot dismiss his action, if the defendant by his answer has sought affirmative relief. Whether he did so is therefore the question to be decided. Conceding that upon the denials in defendant's answer his title would have been quieted by a judgment in his favor if the plaintiff had prosecuted its action, it does not follow that he may not seek and be entitled to affirmative relief. The commencement of the action, and the allegations of plaintiff's complaint, where an attack upon defendant's title to his property, which, however unfounded, impaired the market value thereof and obstructed its alienation; and if the plaintiff should be permitted to dismiss the action, the defendant, in most cases, would feel compelled to bring an action to remove the stain upon his title. It is therefore important to him to prevent a dismissal and compel a trial of the action, and this he may do by setting up his own title and right of possession, and praying that it be quieted as against the plaintiff who has asserted an adverse right. It thus appears that the action to quiet title, in some of its features, is peculiar. The defendant's title may never have been questioned, and therefore no cause of action existed in his favor against any one; but the plaintiff, by bringing the action, created a cause of action in the defendant against the plaintiff, for it was the assertion of an adverse claim or interest in the same property."
 The rule thus suggested is now well established in quiet-title actions. In Collins v. Bridge Investment Co., 20 Cal.2d 52 [123 P.2d 436], the court said: "Where the defendant seeks affirmative relief in a quiet title action, the plaintiff is not entitled to dismiss the action as of right." In Hough v. Wright, 127 Cal.App. 689 [16 P.2d 301], an action to set aside a deed and to quiet the plaintiff's title to a portion of certain property, it was held that an answer alleging that the defendant was the owner of the property and praying for a decree in her favor brought the case within the provisions of subdivision 1 of section 581, Code of Civil Procedure, "and thus prevents a dismissal of the action by the plaintiff." There are many cases involving other kinds of actions where a similar rule has been applied, of which only a few need be *592 cited. (Swanson v. Siem, 7 Cal.2d 267 [60 P.2d 281]; Calhoma Oil Corp. v. Conniff, 207 Cal. 648 [279 P. 771]; Simmons v. Simmons, 45 Cal.App.2d 697 [114 P.2d 660]; Rodgers v. Parker, 136 Cal. 313 [68 P. 975].) In Bayle-Lacoste & Co. v. Superior Court, 46 Cal.App.2d 636 [116 P.2d 458], it is said: "Litigants should not be permitted to inject themselves into a controversy, raise issues therein and then change position and seek to avoid the contest." This is peculiarly true where the plaintiff has attacked the validity of an agreement affecting property rights, upon which the defendant has long relied, and when he has, by answer and cross-complaint, met the issue thus raised and sought a determination thereof.
 Similar principles are applicable here. The complaint herein was one to cancel and set aside an agreement which had been in force for several years, for declaratory relief and, in effect, to establish appellant's title to a community interest in certain property. The answer and cross-complaint sought a judgment that the appellant take nothing, that it be decreed that the agreement was valid and binding and that the appellant had no right, title or interest in this property, other than as provided for in the contract. In effect, the respondent asked for declaratory relief, and that the validity of the contract and his title to the property be confirmed. Not only could the respondent have maintained an action for declaratory relief, had this action never been brought, but under well established principles there was a sufficient request for affirmative relief, within the meaning of the code section, to make the matter of a dismissal of the action one within the discretion of the court, and not one which was mandatory or to which the appellant was entitled as a matter of right.
 The judgment is affirmed.
 Marks, J., and Griffin, J., concurred.
