
49 Cal.App.2d 162 (1942)
ERWIN B. HEBERT et al., Respondents,
v.
JOE H. GRAY, Appellant.
Civ. No. 2931. 
California Court of Appeals. Fourth Dist.  
Jan. 14, 1942.
 James L. King and Harold King for Appellant.
 Brittan & Mack and Roland S. Woodruff for Respondents.
 GRIFFIN, J.
 Plaintiffs obtained judgment against the appellant for $830.83 together with interest and costs. The sole question presented upon this appeal is the jurisdiction of the superior court over the subject matter of the action *163 and is presented upon the judgment roll alone. The action was originally filed in the Superior Court of Kern County against the defendants Joe H. Gray and the General Petroleum Company of California, a corporation. Upon motion of defendant Gray, the action was transferred to the Superior Court of San Bernardino County. Thereafter the defendant General Petroleum Company of California answered. A first amended complaint was then filed. A demurrer was filed to the first amended complaint by appellant Gray on all the statutory grounds including no jurisdiction of the subject matter, and after being duly argued and presented was overruled. Thereafter an answer and pleading denominated a counterclaim was filed by the defendant Gray. In due time the case came on for trial on the first amended complaint and the answers and so-called counterclaim. At the conclusion of plaintiffs' case a nonsuit was granted as to the defendant General Petroleum Company of California, a corporation. At the conclusion of the trial the court permitted the plaintiffs to file an amended and supplemental complaint to conform to the evidence, and thereafter entered its findings and judgment as above mentioned.
 The allegations of the first amended complaint, in effect, are that the plaintiffs were the owners of certain premises in the town of Barstow, San Bernardino County, upon which was located an automobile service station; that on August 15, 1938, the plaintiffs leased the service station to the defendants and that the defendants promised and agreed to pay plaintiffs the sum of 1 1/2 cents per gallon for all gasoline sold through the service station, said sum being payable monthly on the 15th day of each month from and after August 15, 1938, for a period of five years; that the defendants took possession of the premises and thereafter were in possession and operating the service station; that they failed and refused to pay plaintiffs the said sum due for gasoline sold in the service station by the defendants and that as a result thereof there had become due from the defendants to the plaintiffs the sum of $500 by virtue of the terms of the lease. Thereafter follows the usual allegation of demand and the failure to pay the sum. The concluding paragraph prays for judgment against the defendants for the sum of $500, together with interest and costs. The answer of Gray admits the ownership of the property by the plaintiffs, but denies generally *164 and specifically that the premises were ever leased to him or that he ever agreed to pay the sum of 1 1/2 cents per gallon for gasoline sold at the service station for a period of five years or any other period; denies that he, Gray, ever entered into or took possession of the premises or operated the service station; denies that he is indebted to the plaintiffs in the sum of $500 or in any sum at all. The answer also affirmatively alleges that plaintiffs were in possession of the premises and operating the service station; that the defendant Gray was selling gasoline and oil to the plaintiffs and delivering the same to the plaintiffs at the service station and that the plaintiffs had been paying the defendant for the gasoline and oil as the same was delivered to the service station. Included in the answer is what is designated a "third and separate defense and by way of counterclaim." This portion of the answer affirmatively alleges ownership of the premises by the plaintiffs and affirmatively alleges that on August 15, 1938, the plaintiffs leased the premises to Gray for a period of five years; that Gray is ready, able and willing to enter upon and take possession of the premises but that the plaintiffs have refused and still refuse to deliver the premises to the defendant; that ever since the date of the lease the plaintiffs have been occupying the premises and have been renting a portion thereof to various and sundry persons unknown to the defendant Gray for amounts of money unknown; and that the plaintiffs have been operating the service station. This is followed by an allegation that the plaintiffs have refused to account for any amounts received by them from the rental of the premises and for moneys received in the operation of the service station, and that the amounts so received by plaintiffs are unknown to defendant; that the amounts so received by plaintiffs, less an amount for rental, are due, owing and unpaid to the defendant Gray. Thereafter follows a prayer that the plaintiffs recover no judgment under their complaint; that an accounting of all moneys received by the plaintiffs through operating the service station and auto court or camp ground since the date of the lease be had in order to determine the amount due the defendant Gray; that he have judgment for such amount; that possession of the premises be delivered to him; and for court costs. The court found in all respects in favor of plaintiffs and respondents and further found that the allegations of defendant and appellant's counterclaim were untrue. *165
 It is conceded that San Bernardino township is one having a Class A justice's court, as defined in section 81 of the Code of Civil Procedure, and its original jurisdiction is defined by section 112 of the Code of Civil Procedure. Subdivision (a) of section 1 thereof provides that such justice's courts shall have original jurisdiction of civil actions in all cases at law in which the demand or the value of the property in controversy amounts to $1,000 or less, except cases at law which involve the title or possession of real estate. Subdivision (d) thereof provides that such courts shall have original jurisdiction in cases of equity, when pleaded as defensive matter in any case at law of which they have jurisdiction.
 [1] It is immaterial in the present action whether appellant was the party who moved to transfer this action to the Superior Court of San Bernardino County. If that court to which the action was transferred did not have original jurisdiction, jurisdiction could not be conferred on that court by consent or by motion. (Van Horn v. Justice's Court, 216 Cal. 235, 242 [13 PaCal.2d 704]; Schwartz, Inc., v. Burnett Pharmacy, 112 Cal.App. Supp. 781 [295 P. 508].)
 The question to be determined is whether or not under the pleadings the Superior Court of San Bernardino County had original jurisdiction, and it is admitted by respondents that if the case appealed from comes within the jurisdiction of the justice's court as set forth in the above-mentioned subdivisions of section 112 of the Code of Civil Procedure, the appellant should prevail in this appeal and it should be adjudged that the superior court was without jurisdiction to try this case.
 Respondents contend (1) that the complaint sets forth an action at law which involves the possession of real estate; (2) that the cross-action filed by the defendant sets forth an action which involves the title or possession of real estate; (3) that the cross-action of defendant sets forth an action which seeks affirmative equitable relief; and (4) that if any error was committed by the trial court such error is not prejudicial to the appellant within the meaning of section 4 1/2 of article VI of the Constitution.
 There have been numerous decisions of the Supreme and appellate courts in this state interpreting the language of subdivision (a) of section 112 of the Code of Civil Procedure and the phrase "cases at law which involve ... possession *166 of real estate." In O'Meara v. Hables, 163 Cal. 240 [124 P. 1003], it was said: "The possession here contemplated is, as we have said, either a possession akin to title, as in ejectment, trespass or title by adverse possession where possession is of the essence of the right sought to be established, or it is a possession which for some other good reason becomes a direct and material fact and issue in the case, 'upon which the plaintiff relies for a recovery or the defendant for a defense.' (Holman v. Taylor, 31 Cal. 338.)" See, also, Copertini v. Oppermann, 76 Cal. 181 [18 P. 256]; Hart v. Carnall-Hopkins Co., 101 Cal. 160 [35 P. 633]; Dungan v. Clark, 159 Cal. 30 [112 P. 718]. [2] The next step is whether the present complaint fits within the general concepts of that interpretation. Respondents alleged, in their first amended complaint, not only title to the real property in them, but directly averred possession in appellant. Respondents' right or cause of action depended on possession being established in appellant. The consideration for the lease is 1 1/2 cents per gallon for all gasoline sold by appellants while in possession of the service station. It becomes apparent that it would be necessary for appellant to be in possession for any consideration to accrue under the lease. It would appear, therefore, that possession would be a fact necessary to be determined in order to decide the case.
 In Morrissey v. Morrissey, 191 Cal. 782 [218 P. 396], it was said in discussing the jurisdiction of the justice's court, at page 784:
 "The issue of ownership is tendered by the plaintiff, who conceives that his right of action is based wholly or partly upon it. The jurisdiction of the superior court is thus determined, and cannot await upon the contingency that the answer of the defendant may admit the allegation." (Citing cases.) "This is true even if the issue is incidental. On the other hand, if such a complaint be filed in the justice's court, and an answer be filed which makes no traverse of the allegation of title or possession of the real property, so that no question of such title or possession is involved, the justice's court will have jurisdiction of the action (Hart v. Carnall-Hopkins Co., 103 Cal. 132 [37 P. 196]). If the issue of title or possession is so involved that it must be decided in order to determine the case, the superior court has original jurisdiction of the action, whether the involution may be said to be merely incidental or not." *167
 On the basis of the complaint alone, it fairly appears that possession of the real estate is a direct and material fact and issue in the case, upon which the plaintiff relies for a recovery or the defendant for a defense and would come within the exception as stated in subdivision (a) of section 112 of the Code of Civil Procedure. Irrespective of the correctness of this reasoning, the appellant put the question of possession directly in issue by his answer and based his defenses mainly on that question. In addition thereto, he injected a prayer to be put in possession of the real property under the lease. This prayer was in the nature of an action of ejectment.
 In Camarillo v. Fenlon, 49 Cal. 202, 206, it was said:
 "If a landlord, having the possession, refuses to give it to a lessee, according to the agreement, he renders himself liable to an action of ejectment."
 An action for ejectment, i. e., to recover the possession of real property, is within the original jurisdiction of the superior court. (Article VI., sec. 5, Constitution of the State of California.)
 Appellant also sought an accounting based upon the theory that he was ejected and deprived of his right of possession. In Brix v. People's Mutual Life Insurance Co., 2 Cal.2d 446 [41 PaCal.2d 537], it was determined that the superior court had no jurisdiction of plaintiff's cause of action but it was held that where the matters pleaded in the cross-complaint were such as could be litigated only in the superior court, the filing of the cross-complaint gave that court jurisdiction over the subject-matter of the controversy. In Cloverdale Union High School District v. Peters, 88 Cal.App. 731 [264 P. 273], the court quotes with approval the following statement of law upon this subject by the Supreme Court of the United States:
 "By setting up its counterclaim the defendant became a plaintiff in its turn, invoked the jurisdiction of the court in the same action, and, by invoking, submitted to it ..."
 Regardless of the ruling of the trial court on the demurrer to the first amended complaint on the question of lack of jurisdiction in the superior court, the relief sought by appellant gave the superior court jurisdiction over the subject matter of the controversy between the appellant and the respondents and, having acquired jurisdiction for any purpose, *168 the trial court correctly exercised it for the purpose of settling the rights of the parties to the action. (Tennesen v. Prudential Insurance Co., 8 Cal.App.2d 160, 163 [47 PaCal.2d 1066].)
 Judgment affirmed.
 Barnard, P. J., and Marks, J., concurred.
