On June 22, 1927, under Section 14 of the Federal leasing act (41 Stat. 442, 30 USCA, § 223), the United States, as lessor, gave an oil and gas lease of some 2000 acres of land to plaintiff and 21 other lessees. Plaintiff, claiming a seven-sixteenths interest in the lease, brought this action to quiet its title to 800 acres of the leased lands. The defendant by its answer and counterclaim asserted its right to an undivided eleven-twelfths interest in the lease so far as it applies to said 800 acres, and asked a decree establishing a trust in its favor. A motion by plaintiff for judgment on the pleadings was sustained in the trial court and judgment entered in conformity to the prayer of the petition. The defendant appeals.
The petition alleges the issuance of the lease; possession by the lessees; that plaintiff has a seven-sixteenths interest in the lease and the oil and gas in the leased lands, and that defendant without right asserts and threatens to enforce a claim to an undivided eleven-twelfths interest in the lease as it affects 800 described acres. The prayer is for a decree quieting plaintiff’s right and title against defendant’s claim.
The answer admits the issuance of the lease, denies that the lessees are in possession of the lands in question, and alleges that any right or interest of plaintiff in the 800 described acres is held in trust for defendant as set forth in a counterclaim.
The counterclaim states in some detail the facts upon which defendant relies as showing a trust. We assume that the allegations of this pleading were sufficient to have permitted the defendant to prove the facts substantially as set forth in the following statement:
*430In March, 1914, eight persons located the 800 acres as 5 placer mining claims of 160 acres each. ¥e shall sometimes call these persons “locators,” and their claims “locations,” though there was no allegation of a discovery of mineral when the claims were initiated. The locators took possession of the lands which they were entitled to occupy for the purpose of prospecting for oil and gas. In May, 1914, they leased the lands by written lease that gave the lessee and assigns the exclusive right to drill for and extract oil and gas, reserving to the locators a royalty. The defendant has succeeded to the rights of this lessee by assignment ratified by the locators. The pleading does not state what the lessee by the terms of the lease was required to do to protect the locations, but it is alleged that defendant has at all times complied with the terms of the lease and by itself and others expended many thousands of dollars in drilling operations on and for the benefit of the lands and in complying with the laws relating to the holding of placer mining claims. Another lease to defendant is mentioned, but we do not understand that defendant claims under this lease any right it did not have under the assigned lease. The leases provided that the locators “would protect and procure title to said lands. ’ ’
February 25, 1920, the Federal leasing act was approved. A preferential right to a permit is given to “any person who on October 1, 1919, was a bona fide occupant or claimant of oil or gas lands under a claim initiated while such lands were not withdrawn from oil or gas location and entry, and who had previously performed all acts under existing laws necessary to valid locations thereof except to make discovery and upon which discovery had not been made prior to the passage of this act, and who has performed work or expended on or for the benefit of such locations an amount equal in the aggregate to $250 for each location if application therefor shall be made within six months from the passage of this act.” *431Sec. 19, 41 Stat. 445, 30 USCA, Sec. 228. Upon compliance with tbe permit tbe permittee is entitled to a lease under Section 14, cited above. It is alleged that, on tbe approval of tbe leasing act, tbe locators were entitled to a permit to be followed by a lease, and that under tbeir promise “to protect and procure title to said lands” it was tbeir duty to obtain tbe permit and lease for tbe benefit of defendant.
In June or July, 1920, defendants requested tbe locators “to take steps to protect and perfect title” to the lands included in tbeir locations. At that time, it is alleged, tbe locators could have secured a patent for a part of said claims, “sufficient discoveries having been made and sufficient moneys having been expended to justify tbe granting of such patents,” and could have secured a preferential permit under said Section 19 of tbe leasing act for the remaining claims. Tbe locators failed to comply with the request, and neglected to take any steps whatever to obtain either patents or permits.
August 20, 1920, within tbe six-month period mentioned in Section 19 of tbe leasing act, application for a permit on said 800 acres and other lands was made by plaintiff and several others who, it is alleged, bad no right or interest in said 800 acres or right to permit thereon. On December 19, 1921, this application, so far as it concerned tbe 800 acres, was rejected by tbe Secretary of tbe Interior on tbe ground that tbe applicants bad no right in tbe lands or to a permit.
In March, 1922, more than two years after tbe approval of tbe leasing act, defendant again demanded of tbe locators that they proceed to protect and perfect the title to tbe lands in question. At this time, it is alleged, tbe locators might have procured patent to part of tbeir claims, and permits and leases on tbe others. Tbe locators, however, still refused to make application for either patent or permit.
*432It is then alleged that, about September, 1922, plaintiff and the 21 others (including the eight locators heretofore mentioned) who afterwards obtained the government lease of June 22, 1927, entered into a plan or scheme to obtain an oil and gas permit on the lands in question, and to exclude defendant from participation in such permit in violation of defendant’s rights under its leases from the locators. Pursuant to and to carry out the plan or scheme, these things are alleged to have been done: The locators, without any notice to or knowledge of defendant, entered their appearance in the matter of the application for permit which had been made August 20, 1920 and rejected December 19, 1921, and represented in writing to the Department of the Interior that the parties who had theretofore made said application were the owners of an interest in the mentioned placer mining claims which covered the lands in question, and were, with said locators, entitled to a permit, which said locators requested the Department to issue. The locators also represented to the Department that defendant had no longer any interest in said lands or the locations thereof, but had theretofore forfeited and abandoned all its rights under the leases from the locators. The locators deeded the lands to the United States. It is then alleged that, on the strength of said representations and because of said deeds having been given, and relying on said representations and believing the same to be true, and in total ignorance of the rights of the defendant, the Department of the Interior, on May 9, 1923, issued an oil and gas permit on the lands to the locators of the placer claims and the parties, including the plaintiff, who had previously filed the application for a permit. Thereafter, the same parties secured the lease of June 22, 1927. Defendant is being excluded from the benefits of said lease which it claims is held by the lessees in trust for it. The prayer is that the trust be declared and that it be executed by assignment of an undivided eleven-twelfths interest to defendant.
*433It is said that a motion for judgment on the pleadings should not be allowed to usurp the functions of a demurrer. In this case, the motion raised the same questions that would have been raised by a demurrer on the ground that the defendant’s pleading failed to state a defense. Motions for judgment on the pleadings, before trial, are recognized in practice under the Wyoming and other similar codes of procedure. See: State ex rel. Tibbals v. District Court, 42 Wyo. 417, 1 Pac. (2d) 74; Kime v. Jesse, 52 Neb. 606, 72 N. W. 1050; Humboldt Mining Co. v. American etc. Co., 62 Fed. 356. The motion ought not to be permitted to cut off the right to amend. Hancock v. Luke, 46 Utah 26, 148 Pac. 452. Where, as in the case at bar, there was no offer or request for leave to amend, the party against whom the-decision goes cannot be held to have been prejudiced because his pleading was tested on such a motion instead of a demurrer. Dailey v. Chappell, 12 Oh. C. C. (N. S.) 561.
We come, then, to a consideration of defendant’s pleading. The government lease in which defendant claims an equitable interest is affirmed for the purposes of the suit. See, Parker v. Sinclair, 25 F. (2d) 570, 572. The allegation that the locators under whom defendant claims might have obtained patents to some of the lands is immaterial. To procure a permit and lease under the leasing act it was necessary to relinquish to the United States claimed rights under the general mining laws. Departmental Regulations of March 11, 1920, paragraph 20 (f), 47 L. D. 454.
As will be seen from what is said elsewhere in this opinion, the allegation that in March, 1922, the locators might have procured a permit and lease cannot be taken to mean that the locators then or thereafter had a right to be preferred in the granting of such permit and lease.
The lease from the United States by the Secretary of the Interior under the leasing act must be accepted in this action as settling the legal interests of the parties. French v. Fyan, 93 U. S. 169; Henderson v. Midwest Refining Co., *43443 F. (2d) 13, 23. ¥e assume, however, that if the lease was obtained by fraud, mistake or imposition, a court may divest or control the title of a lessee on behalf of one who shows that by the law properly administered the lease should have been awarded to him. See: Duluth & Iron Range R. Co. v. Roy, 173 U. S. 587. The counterclaim does not show that defendant should have been named as a lessee in the lease. Its claim is based on a lease from the locators. The Department in making leases does not recognize such claimants, but grants leases only to the holders of record mining titles. Burke v. Taylor, 47 L. D. 585, 586; Son v. Midway Southern Oil Co., 48 L. D. 210. The representations alleged to have been made to the Department of the Interior were immaterial. If defendant’s claimed interest in the placer locations had been fully disclosed to the Department, a lease to defendant would not have been granted.
Section 19, supra, of the leasing act provides that: “All permits or leases hereunder shall inure to the benefit of the claimant and all persons claiming through or under him by lease, contract, or otherwise, as their interests may appear.” This is commonly called the “inuring clause.”
Before the defendant can benefit by this inuring clause, as against the plaintiff in this action, it would have to be shown that under the law properly administered the interest which plaintiff has under the lease should have been granted by the Department of the Interior to the locators under whom defendant claims. See, Anicker v. Gunsburg, 246 U. S. 110; Hodgson v. Federal Oil Co., 274 U. S. 15.
We assume that the alleged facts show that the locators, for 6 months following February 25, 1920, had a preferential right to a permit, and should have exercised their right and obtained a permit which, under the inuring clause, would have been held by them for the benefit of the defendant. But the right was waived (Re Murane, 48 L. D. 526, 532) and both the locators and defendant lost the right to a permit under Section 19. The plaintiff is not *435charged with doing anything to cause or induce the locators to fail to exercise their preferential right. The first association of plaintiff with the locators was more than two years after the right was waived. The Departmental recognition of the locators as parties entitled to only a part interest in the permit issued in May, 1923, was apparently a matter of discretion, which the courts will not assume to control. Anicker v. Gunsburg, supra. It is not enough that false representations may have been made to the Department; it must appear that the representations affected its determination which, otherwise, would have been in favor of the locators under whom defendant claims. Lee v. Johnson, 116 U. S. 48. The locators had no vested interest in the lands and, but for their association with plaintiff in applying for and carrying out the conditions of the permit, might never have had any interest in the lease. Whether their interest in the lease may inure to the benefit of the defendant is, of course, a question that cannot be decided in this action.
Defendant contends that, though its pleading may not show its right to the judgment for which it prays, yet the allegations of its counterclaim taken as true do show that the plaintiff has been guilty of improper conduct in regard to the subject matter of the litigation, and, therefore, the judgment in accordance with the prayer of the petition disregards the maxim that he who seeks relief in equity must come into court with clean hands. The cited authorities apply the maxim in a great variety of cases, but we have failed to find any case where misconduct in obtaining a lease or patent from the government has been deemed a sufficient ground for refusing to quiet the title of the patentee or lessee as against the claim of one who fails to show that the misconduct prevented him from obtaining the patent or lease. In Sioux City etc. Land Company v. Griffey, 143 U. S. 32, plaintiff claimed under patent from the State of Iowa after a railroad aid grant from the United States to the State. Defendants claimed under patent from the *436United States to Griffey under the preemption laws, and filed a cross-petition for a decree quieting their title. Plaintiff claimed that Griffey never complied with the preemption laws; that he secured his rights by false representations and a pretended settlement, and was entitled to no relief as he did not come into a court of equity with clean hands. The court said: “It was no matter of interest to the company what became of the title. The government, the owner of the land, was satisfied with what Griffey had done, took from him its land warrant as payment, and patented the land. Into the bona, fides of this transaction, no one but the government can inquire. As the title was beyond challenge on the part of the railroad company, it had no right to east a cloud thereupon, and having done so by accepting a patent from the State of Iowa, * * * it does not lie in its mouth, or with those claiming under it, to now object to a decree removing all cloud cast by such patent. ’ ’ See, also, American Assn. v. Innis, 109 Ky. 595, 60 S. W. 388.
The lease under which plaintiff claims, and by which defendant also seeks to obtain an interest in the lands, was issued to plaintiff and other permittees after their performance of the conditions of a permit. It has been said that after a permit has been executed by a permittee, and a lease obtained, it would be most inequitable to substitute another lessee for the permittee. Witbeck v. Hardeman, 51 F. (2d) 450, 452. It would seem that the right of such a lessee ought not to be clouded by permitting the continued assertion of a claim by one who was not a party to the permit and can establish no superior right to the lease. The United States, not a party to the action, is a party to the lease and, perhaps, would be injuriously affected by a disposition of this case that would leave a cloud to embarrass its lessees in their operations under the lease. We do not think the pleaded facts required that the plaintiff be denied relief bn the ground that it did not come into court with clean hands.
*437As defendant’s pleading admitted the lease and plaintiff’s interest thereunder, and failed to allege facts to justify the court in declaring a trust in defendant’s favor, the motion for judgment on the pleadings was properly sustained, and the judgment will he affirmed.
Affirmed.
Blume and Riner, JJ., concur.