
7 Cal.2d 671 (1936)
MILO THOMSON, Plaintiff and Respondent,
v.
SAMUEL CLARK THOMSON, Appellant; RETTA TUTTLE THOMSON, Cross-Defendant and Respondent.
S. F. No. 15593. 
Supreme Court of California. In Bank.  
November 18, 1936.
 Meurice Swim for Appellant.
 Barrett & Barrett for Respondent.
 CURTIS, J.
 Action to quiet title to real property situated in the city and county of San Francisco. The complaint is in the usual form of actions of that type. The defendant answered and alleged that he was the owner of an undivided one- fourth of the real property of which the plaintiff claimed to be the sole owner. In addition to his answer, he filed a cross-complaint making the plaintiff a cross-defendant, and bringing in and making a party to said action, Retta Tuttle Thomson, the mother of the plaintiff and defendant, the two parties named in the original complaint being brothers. In his cross- complaint, the defendant *674 claimed that under a verbal agreement with his mother on or about the 25th day of July, 1925, in consideration of certain monthly payments to be made by him to his mother, he "would then and there and from said aforementioned date, have a one-fourth (1/4) interest", subject to a life estate to his mother, in the real property described in the complaint. He further alleged that, after the making of said agreement, he and his mother resided on said land as their home until the mother conveyed the whole of said real property to the plaintiff, who thereafter ejected defendant from said real property. In a separate count, the defendant alleged that the plaintiff and his mother were indebted to defendant in the sum of $1680 for money had and received by them to and for the use of the defendant. An answer to this cross-complaint was filed by the plaintiff and his mother in which they denied the material allegations of the cross- complaint. They also raised by answer, as they had previously done by demurrer, the question as to whether the second count of the cross-complaint was barred by the provisions of section 442 of the Code of Civil Procedure. By this we understand that they intended to raise and did raise the question as to whether a cross-complaint for money had and received would lie in an action to quiet title.
 Prior to the action being called for trial, and within the time provided by law and the rules of said court, the defendant demanded a trial by jury, which the court denied. The case was subsequently tried by the court without a jury, and resulted in a judgment in favor of the plaintiff and his mother, from which the defendant has appealed.
 Practically the sole point made by the defendant is that the court erred in denying him a jury trial in this action.
 Ae we have before stated, the action of the plaintiff is an action to quiet title to real property. The plaintiff was, at the time of the commencement of the action, and for a long time prior thereto had been in possession of said real property. In the answer and cross-complaint defendant avers that he was at a time some two and one-half years prior to the commencement of the action in possession of said real property and that plaintiff ousted him of such possession. *675
 The action to quiet title to real property, and by subsequent amendment to personal property, is provided for by section 738 of the Code of Civil Procedure. This is a statutory action, and in the early case of Curtis v. Sutter, 15 Cal. 259, Mr. Justice Field discusses the character of such an action and the nature of the issues therein, that is, whether they are equitable and triable by the court, or legal and, therefore, cognizable in a court of law. We quote from this discussion as follows: "This statute enlarges the class of cases in which equitable relief could formerly be sought in the quieting of title. It authorizes the interposition of equity in cases where previously bills of peace would not lie. Such bills were of two classes. Those of one class lay where the right which the plaintiff asserted, was controverted by numerous persons, holding distinct and separate interests depending upon a common source. A right of fishery asserted by one party, and controverted by numerous riparian proprietors on the river, and a right to tithes claimed by a parson and controverted by his parishioners, are instances cited by Story where a bill of this nature would lie. Bills of the other class lay where the plaintiff was in possession of real property, and his possession had been disturbed by legal proceedings, in which his title had been successfully maintained. To the prosecution of bills of this latter class, the concurrence of three particulars was essential--the possession in the plaintiff, the disturbance of that possession by legal proceedings on the part of the defendant, and the establishment of the right of the plaintiff by judgment in his favor in such proceedings. (Sheply v. Rangely (Fed. Cas. 12,756), Davies' R. of the U.S. Circuit Court for Maine, 249.) The necessity of bills of this class naturally arose from the nature of the action of ejectment, which being founded on a fictitious demise between fictitious parties, a recovery therein constituted no bar to another action. Thus the successful party might, by repeated actions, be subjected to vexatious and harassing litigation, and to procure repose, Courts of Equity interposed and finally terminated the controversy. It was in this way, only, that adequate relief could be administered. (Devonsheer v. Newenham, 2 Sch. & Lef. 208; Welby v. The Duke of Rutland, 6 Bros. Parl. Cas. 575.) Under the statute of this State it is unnecessary for the plaintiff to *676 delay seeking the equitable interposition of the Court, until he has been disturbed in his possession, by the institution of a suit against him, and until judgment in such suit has passed in his favor. It is sufficient if, whilst in the possession of the property, a party out of possession claim an estate or interest adverse to him. He can immediately, upon knowledge of the assertion of such claim, require the nature and character of the adverse interest to be produced, exposed and judicially determined, and the question of title be thus forever quieted. It does not follow from the fact that the suit is brought in equity, that the determination of questions purely of a legal character in relation to the title, will necessarily be withdrawn from the ordinary cognizance of a court of law. The court sitting in equity may direct, whenever in its judgment it may become proper, an issue to be framed upon the pleadings and submitted to the jury. Upon the verdict of the jury, if a new trial be not granted, the Court will then act, by either dismissing the bill, or by adjudging the adverse estate or interest claimed to be invalid, and of no effect, and awarding a perpetual injunction against its assertion to the property in question. There is no difficulty in so conducting a suit, under the statute, as to fully protect the legal rights of the parties, and at the same time to secure the beneficial result afforded by a court of equity in bills of peace--which is, repose from further litigation. Indeed, the remedy under the statute is eminently simple, direct and efficacious for this purpose. (Merced Mining Co. v. Fremont, 7 Cal. 317, 319 [68 Am. Dec. 262].)"
 The statute which was the subject of this comment by Mr. Justice Field was section 254 of the Practice Act, which is the same as the original section 738 of the Code of Civil Procedure, except that the section of the Practice Act limited the action to quiet title to one in possession of real property. Section 738 of the Code of Civil Procedure makes no such limitations and under its provisions an action to quiet title may be brought by the owner of land even if he is out of possession. (Cobe v. Crane, 173 Cal. 116, 119 [159 P. 587].)
 In Donahue v. Meister, 88 Cal. 121 [25 P. 1096, 22 Am.St.Rep. 283], the action was instituted under section 738 of the Code of Civil Procedure to quiet title to a certain *677 quartz-mining claim and land called by the plaintiff the "Uncle Sam" claim. The complaint was in the usual form and contained an averment that the plaintiff was in possession of the premises in contest. In the answer all the averments of the complaint were denied except that of possession. It was further averred in the answer that defendant was entitled to the possession of the south half of said claim, and was lawfully possessed thereof for several years next preceding April 6, 1889, when the plaintiff wrongfully entered thereon and ousted defendant therefrom and that plaintiff wrongfully withholds the same from defendant. In the prayer of the answer, the defendant asked to be restored to possession. In proper time, the defendant demanded a jury "on the issue raised by his said averments of prior possession and ouster", which the court refused. This court, after discussing Judge Field's language quoted above and some later cases, comments upon the action to quiet title, as provided in section 738 of the Code of Civil Procedure as follows (p. 127): "It is really a statutory action. The code confers equitable rights so far as it grants the power to maintain the action at all, and the decree is in form equitable, but if it has to deal with ordinary common law rights clearly cognizable in courts of law, it is to that extent an action at law." The court further held that under the facts presented in that case the defendant was entitled to have his case tried by a jury and reversed the judgment of the trial court. In so holding the court expressed its conclusion as follows (p. 128): "In the case at bar, according to the verified answer, defendant was entitled to possession, and was in the possession of the disputed premises a short time before the commencement of the action, and was ousted by plaintiff. If, under these circumstances defendant had commenced an action against plaintiff to recover possession, it would have been conceded by all that either party would have been entitled to a jury trial. But it is equally clear that plaintiff, by first bringing suit, and thus inverting the parties, could not deprive defendant of his right to a jury. If it were not for the provision of the code, plaintiff would have been compelled to wait until defendant commenced his action, and then there would have been no question about the right to a jury; but while the legislature had the power to grant the plaintiff the privilege *678 of himself commencing the suit, it had not the power to give him, and we think did not intend to give him, the privilege of thus depriving the defendant of his constitutional right."
 In Angus v. Craven, 132 Cal. 691, 696 [64 P. 1091], this court held as follows: "It is argued from various standpoints--one of which is, that the action must be treated solely as an action to quiet title, under section 738 of the Code of Civil Procedure. Taking this view of the case, it may be said that a complaint under section 738, having no averments inconsistent with the scope of that section as heretofore construed, presents, on its face, a case for equitable remedy. It seeks to have something done which a court of law cannot do. It invokes a decree in equity--not a mere judgment at law, which, in its nature, is only for the recovery of the possession of specific real or personal property, or for damages. The purpose of the section is evidently to afford a remedy similar in character to that of the old bill of peace, but extending it to cases which the latter remedy did not reach. (See Curtis v. Sutter, 15 Cal. 259.) Courts, however, in guarding the constitutional rights to a jury trial, have repeatedly held that where the suit should have been, and in substance is, an action for the recovery of the possession of land, the right of a defendant to a jury cannot be defeated by the mere device of bringing the action in an equitable form. And so it has been held that the right to a jury is not defeated, where, at the commencement of the action, the defendant, and not the plaintiff, was in the actual possession of the premises involved; and it has also been held that where the defendant had been for a long time in the actual possession, and the plaintiff had ousted him, the plaintiff, by first bringing his action to quiet title, could not, by such inversion of parties, avoid the defendant's right to a jury but that the action should be treated as substantially an action to recover possession. But this is as far as this court has gone in Donahue v. Meister, 88 Cal. 121 [25 P. 1096, 22 Am.St.Rep. 283]; Newman v. Duane, 89 Cal. 597 [27 P. 66]; Gillespie v. Gouly, 120 Cal. 515 [52 P. 816]; Moore v. Copp, 119 Cal. 429 [51 P. 630], and kindred cases. As was substantially said in Donahue v. Meister, supra, the decision of the question whether, in an action brought under section *679 738, either party is entitled to a jury must depend greatly upon the facts in that particular case. It has never been held by this court that an action to quiet title under the code cannot be maintained as an equitable action, where the plaintiff was, and for a considerable period of time had been, in actual possession, and defendant had never been in possession, or that in such case a defendant can overthrow the equitable character of the action by simply answering that he has title, and praying that he, for the first time, be let into possession. A complaint showing that plaintiff is the owner of the land, and in actual possession of it, and that defendant asserts some right or title thereto which is unfounded, followed by an answer admitting plaintiff's possession, and not showing prior possession in defendant, seems to present the very action contemplated by the code provision; and, under these conditions, its continued equitable character is not affected by the particular kind of right which the defendant sets up. Therefore, if we are to consider the case at bar solely in the light of an action to quiet title under section 738, we do not think that, under the conditions above stated, the court below erred in denying appellant's demand for a jury."
 In McNeil v. Morgan, 157 Cal. 373, 378 [108 P. 69], the plaintiff brought an action to quiet his title to real property against the administrator of the estate of James McNeil, deceased. Margaret McNeil, the surviving wife, and James McNeil, the son of the deceased, intervened in the action, claiming to be the owners of the land in question and prayed that they recover possession of the land. The original parties to the action had waived a jury, but after interveners came into the case, they demanded a jury trial. Thereafter, Margaret McNeil dismissed her complaint in intervention. The court denied the demand for a jury, and the case went to trial before the court alone. This court held that the fact that the original parties to the action had, before the interveners came into the case, waived a jury trial, did not affect the right of the intervener to have his case tried before a jury, provided he was entitled to a jury trial. In passing upon this question, the court held as follows: "Intervening in a case in which the possession of the property had been alleged by the original plaintiff who asserted exclusive ownership, James McNeil is in exactly the *680 position of the original defendant out of possession who asserts title and the right of possession as against the person in actual possession. As such a defendant, he would not have a right to a trial of the matters of fact by jury unless he had been recently dispossessed by the nominal plaintiff. In such a case he would be treated as really a plaintiff in possession entitled to demand a trial by jury of the issues of fact involved."
 In that case the court cites with approval the case of Johnson v. Peterson, 90 Minn. 503 [97 N.W. 384], and quotes from it as follows: "The character of this action has been heretofore stated. It was brought to determine an adverse claim to real property; the plaintiff being in possession, and the answer setting up a counterclaim in ejectment. Except as otherwise provided by statute, all the ordinary rules governing suits in equity to quiet title apply to this action, and it was triable by the court and not by a jury. (Roussain v. Patten, 46 Minn. 308 [48 N.W. 1122].) See, also, Larkin v. Wilson, 28 Kan. 513; Angus v. Craven, 132 Cal. 691 [64 P. 1091], in which the same rule is announced. Under the complaint the case was for trial by the court without a jury, and the fact that the answer contained a counterclaim in the nature of ejectment did not change the procedure."
 In the case of Cobe v. Crane, 173 Cal. 116, 119, 120 [159 P. 587], we find the following statements, which in our opinion, bear upon the question now before us. (Page 119.) "Plaintiff's complaint was in the ordinary and usual form to quiet title, to which was added the allegations of the excessive and unwarranted litigation brought and prosecuted by Arthur Crane for purposes of harassment. We are told by appellants that 'it is fatally deficient in that it does not state any possession or right of possession'. The owner of land does not have to be in possession to enable him to maintain his action to quiet title." (Citing authorities.) (Page 120.) "Appellants further complain that they were denied a trial by jury. Plaintiff's complaint was not that of a plaintiff out of possession seeking to recover possession. His action was one simply to quiet title. The evidence showed that plaintiff was in possession. The judgment makes no mention of possession. Of course, defendants were not entitled to a jury trial under *681 the circumstances. (Angus v. Craven, 132 Cal. 691 [64 P. 1091].)"
 [1] These authorities establish the following principles of law respecting the nature and character of an action to quiet title.
 (1) In a simple action to quiet title when the possession of the property is not involved, it is an equitable action.
 (2) When the right of possession is involved, the nature of the action, that is whether it is cognizable in an action at law, or in a court of equity, depends upon the following facts and circumstances.
 (a) If plaintiff is in possession and no claim is made that he has ousted the defendant of possession, the action is equitable and triable by the court without a jury.
 [2] (b) If plaintiff is in possession and defendant by answer or complaint avers that he was recently ousted of possession of the property involved, the action is in reality one at law, and the parties thereto are entitled to a jury trial.
 [3] (c) If the plaintiff is out of possession and seeks by an action to quiet title to recover possession, the action is triable in a court of law.
 [4] (d) If plaintiff is in possession, and the defendant by answer or cross-complaint seeks to eject the plaintiff and recover possession, the action involves both equitable and legal issues. The issues arising out of plaintiff's cause of action are equitable, and those resulting from defendant's answer and cross-complaint are legal. In such an action the plaintiff is entitled to have the equitable issues tried by the court without a jury, and the defendant is entitled to have the legal issues submitted to a jury.
 [5] In the present action, the plaintiff was in possession of the real property at the commencement of the action. The defendant claimed to be entitled to possession and averred in his cross-complaint that plaintiff ousted him from possession some two and a half years before the commencement of said action. Defendant seeks to bring this case within the rule announced in Donahue v. Meister, supra, where the plaintiff ousted the defendant of possession, and then almost immediately brought his action to quiet title against defendant. Defendant in that action by answer alleged his possession and plaintiff's ouster of defendant *682 from possession. As we have seen, the court in that action held that plaintiff could not oust the defendant of possession and turn around and bring an action to quiet title, and in that manner deprive the defendant of the right to a jury trial to determine the right of possession. The court held the action in its entirety was an action at law. In the present case, the defendant, it is true, avers that he was entitled to possession, and that while he was in possession he was ousted by plaintiff. But he admits in his answer that plaintiff had been in possession of the property involved for some two and a half years prior to the commencement of the action. He had ample opportunity during that period of time to test his right to possession in an action in ejectment which he failed to do. After this long delay, he cannot by merely alleging that he was ejected from said real property by plaintiff, convert the action to quiet title instituted by the plaintiff into an action for possession and thus oust the court of its equitable jurisdiction to try the issues arising under plaintiff's complaint to quiet title. [6] These issues the plaintiff was entitled to have tried by the court without a jury. On the other hand, the defendant's cross-complaint stated a cause of action in the nature of an action in ejectment and presented purely legal issues cognizable in a court of law. We, therefore, have for trial in the same action both equitable and legal issues. The procedure to be followed when such a condition exists has been indicated by Mr. Justice Henshaw in a concurring opinion in the case of Angus v. Craven, supra (p. 699), in the following apt language: "Under our system, equitable and legal rights are determined in the same forum. It is within the discretion of the court to control the order of proof upon the issues joined. In the natural order, before defendant was entitled to a hearing upon the equitable issues tendered, she must defeat plaintiffs upon the equitable issues presented by them. This was the view of the trial court, and in pursuance of it, it took to itself, as was proper, the determination of these equitable matters. The result was, that it found defendant's deeds to have been forgeries. Had it reached the opposite conclusion, then defendant might with right have insisted that the remaining issues of law be tried before a jury. But that time never arrived, and I do not concede the right of a litigant to oust *683 a court of equitable jurisdiction in an action of purely equitable cognizance, merely by tendering additional issues which are triable at law before a jury. It is sufficient if a jury be had when those issues come to trial."
 [7] This procedure, as indicated above, was followed substantially by the trial court in the present action. It first passed upon the equitable issues presented by plaintiff's complaint to quiet title and defendant's answer thereto. Having determined these issues in favor of the plaintiff--that is, having found that the plaintiff was the owner of said real property and that defendant had no interest therein, there was nothing further for the court to consider. It necessarily followed, if plaintiff was the owner of said real property at the time the defendant claims he was illegally ejected therefrom and entitled to the possession thereof, that defendant's action by cross-complaint must fail. Had the court found against plaintiff in the action to quiet title, then it would have been its duty to try the issue of ejectment under defendant's cross-complaint. But as Mr. Justice Henshaw said: "That time never arrived," and it was only that issue which the defendant was entitled to have tried by the jury. Under these circumstances, the trial court did not err in denying defendant's demand for a jury trial.
 [8] A further claim is made by defendant that his demand for a jury should have been granted, based upon the second count of his cross- complaint for money had and received. This was a purely legal right, and entitled the defendant to a jury trial if the subject-matter of said count was a proper matter to be litigated by means of a cross-complaint. This count simply set forth a cause of action for money had and received. It in no way related to or depended upon any transaction upon which the action to quiet title was brought, nor did it affect any property to which the action related. It failed to meet the requirements of section 442 of the Code of Civil Procedure. A mere money demand unrelated to plaintiff's cause of action is not a proper subject for a cross-complaint in a quiet title suit. (Meyer v. Quiggle, 140 Cal. 495 [74 P. 40].)
 The judgment is affirmed.
 Langdon, J., Thompson, J., Waste, C.J., Shenk, J., and Seawell, J., concurred.
