OPINION OF THE COURT.
This is a proceeding in mandamus brought against the commissioner of public lands to compel the execution or delivery of a deed or patent for land previously sold by the state to relator upon’ the deferred payment plan. The contract of sale was in the usual form adopted by the state land office, and contained, among other provisions, the following:
“This land is being purchased for the, purpose of grazing *385and agriculture only; that while the land herein contracted for is believed to be essentially nonmineral land, should mineral be discovered therein, it is expressly understood and agreed that this contract is based upon the express condition that the minerals therein shall be and are reserved to the fund or institution to which the land belongs, together with the right of way to the commissioner, of any one acting under this authority, to at any and all times enter upon said land and mine and remove the minerals therefrom without let or hinderance.”
After accepting and acting upon this contract, from August 17, 1917, to March 19, 1919, on that day the relator, desiring to complete his purchase, tendered to the commissioner the total balance of-the purchase price of the land, and demanded a deed conveying the same in fee simple. This was refused by the commissioner, on the ground that the minerals in the land were reserved to the state in the contract of sale, and no conveyance which included them could be demanded. The case was heard in the district court upon the petition and writ, and a demurrer to the same, and the demurrer was overruled. The respondent elected to stand on his demurrer, and not to plead further, and a peremptory writ was awarded commanding the commissioner to execute a deed conveying the fee to relator without reservation of mineral rights. This appeal is prosecuted from that judgment.
It is contended by the Attorney General for the respondent that this proceeding is in effect an action against the state, and cannot be maintained without its consent. This proposition was not raised by the demurrer in the lower court and is presented here for the first time under the first assignment of error, which is to the effect that the court erred in overruling the demurrer because the state was a necessary party. This assignment, under ordinary circumstances, in litigation between private persons, would hardly be held sufficient to present the ques*386tion argued, viz. that this is an action against the' state and cannot be maintained. The question, however, is one of jurisdiction, if the argument advanced is sound, and we ought to and will consider it, especially in view of its public nature.
In approaching the discussion the facts sliould be clearly in mind. It is to be remembered that the lands involved are a portion of the lands granted in trust to the state by the federal government for certain specified purposes. The grant is of the fee, and when the required preliminaries of selection by the state had been performed, and the government had clear-listed the same to the state, it became the absolute owner of the lands, subject only to the trust imposed by the-granting act. In order to avail themselves of the grant, the people in their Constitution created the office of commissioner of public lands (section 1, art. 5), and clothed him with power to select, locate, classify, and have the direction, control, care, and disposition of all public lands, under the provisions of the act of Congress relating thereto, and such regulations as might be provided by law (section 2, art. 13). At the first state Legislature ah act was passed somewhat amplifying the constitutional provisions (see sections 5178 et seq:, Code 1915), and in section 1 of the act (section 5178, Code 1915) his jurisdiction over the land is somewhat more broadly stated, to the effect that it extends to all cases except as otherwise specifically provided by law. It is further to be remembered that the commissioner made a contract of sale of the land in controversy in which the mineral rights were reserved to the state. The state has never contracted to convey the fee of these lands, but has reserved from the sale the mineral rights therein.
The relator bought only the right to the lands for agricultural and grazing purposes, and did not buy the right to the minerals, if any, in the lands. He *387.now seeks to exact from the state something which-the state has never contracted to convey. If he were seeking to compel the commissioner to perform the contract as made, a different question would be presented. If the commissioner were arbitrarily, for some illegal reason or no reason, refusing to carry out a contract which he had made on behalf of the state with the relator, the performance of which would be a mere ministerial duty, his action might perhaps be controlled by mandamus. But he - is doing nothing of the kind. He is simply standing on the contract as made, while relator is seeking from the state something different from what the contract specified. Under such circumstances it is not the action of the commissioner which is sought •to be controlled, but it is the action of the state which it is sought to compel, and thereby secure a property right now held and owned by the state and which it has never agreed to convey. Under such circumstances the proceeding must be considered one against the state.
[1, 2] It is a fundamental doctrine at common law and everywhere in America that no sovereign state can be sued in its own courts or in any other without its consent and permission. See Smith v. Reeves, 178 U. S. 436, 20 Sup. Ct. 919, 44 L. Ed. 1140, in which many former decisions of the Supreme Court are referred to. See, also, Kawananakoa v. Polyblank, 205 U. S. 349, 27 Sup. Ct. 526, 51 L. Ed. 934. See; also, 25 R. C. L. “States,” § 49. At an early date the Supreme Court of the United States held, that under the constitutional provision granting judicial power to the federal courts extending to controversies' “between a state and citizens of another state,” the citizens of one state might sue another state in the federal courts. Chisholm v. Georgia, 2 Dall. 419, 1 L. Ed. 440. This decision met with such popular disapproval that the Eleventh Amendment to the Constitution was immediately *388proposed, and in due course was adopted by the states. This amendment restrained the federal power in terms, and prohibited citizens of one state from maintaining a suit in the federal courts against another state. See Hans v. Louisiana, 134 U. S. 1, 10 Sup. Ct. 504, 33 L. Ed. 842.
While the question as to the jurisdiction of the federal courts under the Constitution and the Eleventh Amendment is not always identical with the question as to the jurisdiction of state courts to entertain actions by its own citizens against the state, it is nevertheless true that the Supreme Court of the United States has been called upon in numerous cases to determine what is and what is not a suit against the state, and the great learning of that court has so illuminated the question as to make those decisions of the highest controlling influence in determining such questions. We believe that the state of opinion of the Supreme Court of the United States-may be stated as follows: Where the contract is between the individual and the state, any action founded upon it against defendants who are officers of the state, the object of which is to enforce the specific performance by compelling those things to be done by the defendants which, when done, would constitute a: performance by the state, or to forbid the doing of those things which, if done, would be simply breaches of the contract of the state, is in substance a suit against the state itself, and within the prohibition of the Constitution. See In re Ayers, 123 U. S. 443, 502, 8 Sup. Ct. 164, 31 L. Ed. 216; Pennoyer v. McConnaughy, 140 U. S. 1, 9, 11 Sup. Ct. 699, 35 L. Ed. 363; Reagan v. Farmers’ Loan, etc., Co., 154 U. S. 362, 389, 14 Sup. Ct. 1047, 38 L. Ed. 1014; Hagood v. Southern, 117 U. S. 52, 6 Sup. Ct. 608, 29 L. Ed. 805; Cunningham v. Macon, etc., R. Co., 109 U. S. 446, 455, 3 Sup. Ct. 292, 609, 27 L. Ed. 992; Louisiana v. Jumel, 107 U. S. 711, 2 Supt. Ct. 128, 27 L. Ed. 448; Antoni v. *389Greenhow, 107 U. S. 769, 2 Sup. Ct. 91, 27 L. Ed. 468; Louisiana ex rel. New York Guaranty, etc., Co. v. Steele, 134 U. S. 230, 10 Sup. Ct. 511, 33 L. Ed. 891. The later cases in the Supreme Court of the United States merely amplify and illustrate the principles which have been developed in the cases cited above, and need not be cited here.
On the other hand, where the law directs or commands a state officer to perform an act under given circumstances, which performance is a mere ministerial act, not involving discretion, mandamus will lie to compel the action, notwithstanding performance of the state’s contract may incidentally result. In such a case the action is not really upon the contract, but is against the officer as a wrongdoer. He is, under such circumstances, not only violating the rights of the relator, but is disobeying the express command of his principal, the state. Injunction will likewise lie to restrain illegal action of a state officer, notwithstanding a breach of the state’s contract may thus incidentally be prevented. Upon this subject there are many cases, only a few of which need be noticed.
Pennoyer v. McConnaughy, 140 U. S. 1, 11 Sup. Ct. 699, 35 L. Ed. 363, was a suit in equity to restrain and enjoin the Governor, secretary of state, and treasurer of the state of Oregon from selling and conveying a large amount of land to which the appellee asserted title. The law in that state provided a method for the disposal of the lands, and appellee’s predecessor in title made application to purchase a large quantity of these lands in pursuance of the provisions of the act, and paid to the board of commissioners, as required by tne act 20 per centum of the price of the lands. After appel-lee’s predecessor in title had made his application, but before he had made his first payment, the Legislature of Oregon passed an act repealing the *390act under which the application for the lands had been made, and authorized and directed the commissioners to cancel all certificates of sale of the kind held by the appellee’s predecessor in title. In pursuance of this act the board of land commissioners cancelled the certificates of sale in question and ordered the lands to be sold, and had actually sold a portion of the same when the action was filed. After an elaborate review of all the cases up to that time the court said:
“This immunity of a state from suit is absolute and unqualified, and the constitutional provision securing it is not to be so construed as to place the state within the reach of the process of the court. Accordingly, it is equally well settled that a suit against the officers of a state, to compel them to do the acts which constitute a performance by it of its coptracts, is, in effect, a suit against the state itself.
“In the application of this latter principle, two classes of cases have appeared in the decisions of this court, and it is in determining to which class a particular case belongs that differing views have been presented.
“The ;fir§t ''-class is where the suit is brought against the officers of.jthe state, as representing the state’s action and liability, thijs making it, though not a party to the record, the real party against which the judgment will so oparate as to compel. it to specifically perform its contracts. [Citing cases.] ",
“The other class is where a suit is brought against defendants' who, claiming to act as officers of the state, and under.the color of an unconstitutional statute, commit acts of wrong and injury to the rights and property of the plaintiff acquired under a contract with the state. Such suit, whether brought to recover money or property in the hands of such defendants, unlawfully taken by them in behalf of the s.tate, or for compensation in damages, or, in a proper case. where the remedy at law is inadequate, for an injunction. to prevent such wrong and injury, or for a mandamus, in a like case, to enforce upon the defendant the performance of a plain, legal duty, purely ministerial— is not, within the meaning of the Eleventh Amendment, an action against the state. [Citing cases.]
Following this statement is an elaborate review of most of the cases in the Supreme Court up to *391that time, and the decree enjoining the board of land commissioners was affirmed. This case is authority, for the proposition that the fact that the rights ought to be protected or secured arise out of a contract’ with the state is not determinative of the question as to whether the suit is in fact against the state. If the action sought to be controlled is wrongful, either by reason of being in pursuance of an unconstitutional statute, or by reason of the unlawful action of a public officer, the right to restrain the action is complete, and a proceeding for that purpose is not a suit against the state.
Poindexter v. Greenhow, 114 U. S. 270, 5 Sup. Ct. 908, 962, 29 L. Ed. 185, was an action in detinue tb recover possession of personal property seized for taxes under an unconstitutional statute which impaired the obligation of a contract between the state of Virginia and holders of coupon bonds of the state to receive said bonds and coupons in payment of the taxes. The action was held not against the state. In the discussion it is pointed out that, unless the state is a party in a substantial sense, suits between individuals may be maintained, notwithstanding their determination may incidentally and consequently affect the state’s contract.
In Board of Liquidation v. McComb, 92 U. S. 531, 23 L. Ed. 623, the decree appealed from was for an injunction to restrain the board of liquidation of the state of Louisiana from using the bonds of the state for the liquidation of a certain debt claimed to be-due from the state to the Louisiana Levee Company, and from issuing any other state bonds in payment of said pretended debt. McComb alleged that he was the holder of some of the bonds, and that the employment of the bonds for the purpose proposed would depreciate their value. The defendants demurred, and, the demurrer being overruled, and the defendants refusing to plead further, a decree was *392entered. These bonds were issued under an act of the Legislature for the purpose of refunding the state debt. Subsequent to the issue of these bonds the Legislature passed an act authorizing the diversion of a portion of the same to the Louisiana Levee Company in liquidation of a debt to it which was not of the character or kind contemplated by the act under which the bonds were issued. The court held that injunction was- a proper remedy in such cases, as the state officers, in order to justify their conduct, must rely upon an unconstitutional law, which was no protection, and left them in the position of wrongdoers. In that case it is said that, where a plain official duty, requiring no exercise of official discretion, is to be performed, mandamus to compel action or injunction to restrain illegal action may be had, citing Osborn v. Bank, 9 Wheat. 859, 6 L. Ed. 204; Davis v. Gray, 16 Wall. 230, 21 L. Ed. 447.
In Greenwood Cemetery Land Co. v. Routt, 17 Colo. 156, 28 Pac. 1125, 15 L. R. A. 369, 31 Am. St. Rep. 284, it was held that the court had jurisdiction of an action brought for the purpose of requiring the state board of land commissioners, which included the Governor, to receive money of the plaintiff, and to issue it a deed or patent to be signed by the Governor. This case was followed in Colorado Fuel & Iron Co. v. State Land Commissioners, 14 Colo. App. 84, 60 Pac. 367, in which the land commissioners were compelled to issue a lease after it had exercised its discretion and had contracted for the lease; also, in State Land Commissioners v. Carpenter, 16 Colo. App. 436, 66 Pac. 165, an action was maintained against the state land commission respecting the reinstatement and cancellation o'f leases.
In State ex rel. McEnery v. Nicholls, 42 La. Ann. 209, 7 South. 738, the relator had contracted with the then Governor of the state in pursuance of an *393act of the Legislature to recover for the state all lands donated to her by the government as swamp lands, and he was to receive a certain percentage of the lands secured by him as the attorney for the state. The succeeding Governor and the then register of the state land office refused to comply with the contract and to allot to the relator his proportion of the lands. The court awarded a peremptory mandamus to compel the performance of what the court denominates a ministerial duty prescribed by the law authorizing the making of the contract with relator.
'In State v. Toole, 26 Mont. 22, 66 Pac. 496, 55 L. R. A. 644, 91 Am. St. Rep. 386, a mandamus against the state furnishing board to compel it to enter into a formal contract for furnishing supplies by the relator was sustained. Relator’s bid had been accepted, but the board refused to enter into the contract;, solely because some labor organizations had protested against the contract. The proposal of the plaintiif was regularly accepted, and the contract let to it as the lowest responsible bidder after a compliance with all the statutory requirements. The state, by its authorized agent, awarded a contract, and the object of the proceeding was to compel the defendants as public officers to sign the formal contract, and thereby perform what is alleged to be their ministerial duty. The court, after quoting from In re Ayres, 123 U. S. 506, 8 Sup. Ct. 164, 31 L. E. 216, holds that mandamus will lie to compel the execution of the contract, and says:
“If the defendants owe to the plaintiff the performance of an act which the law specifically enjoins as a duty resulting from an office — in other words, if the defendants as members of the board owe to the plaintiff a duty, and the performance of that duty is a ministerial act not involving the exercise of discretion or judgment — the writ of mandate will lie to compel such performance, and the state is not thereby subjected to an action or proceeding.”
See, also, on this subject 26 Cyc. p. 227; 36 Cyc. *394917; 25 R. C. L. “States,” § 50; 26 A. & E. Ency. Law, 490, 491; 1 Rose’s Code Fed. Proc. pp. 50, 51.
Exhaustive notes are appended to the following cases, where most, if not all, of the cases on this subject are collected. See Pitcock v. State, 91 Ark. 537, 131 S. W. 742, 134 Am. St. Rep. 88; Louisville & Nashville R. R. Co. v. Railroad Com’rs, 63 Fla. 491, 58 South. 543, 44 L. R. A. (N. S.) 189; Miller v. State Board of Agriculture, 46 W. Va. 192, 32 S. E. 1007, 76 Am. St. Rep. 811; Cooke v. Iverson, 108 Minn. 388, 122 N. W. 251, 52 L. R. A. (N. S.) 415.
There is a distinction sometimes pointed out in the cases between the applicability of injunction and mandamus where the question is as to whether suit is or is not against the state. This distinction is pointed out, and other cases discussed, in Pennoyer v. McConnaughy, supra. The two remedies largely cover the same field. If the state has commanded, and the duty is ministerial, mandamus may be had to compel action or injunction to restrain violation of the duty. Board of Liquidation v. McComb, supra. Neither would be actions against the state. The control of the officer would be, in either case, merely effectuating what the state had already commanded. In case, however, a state is the wrongdoer, and the officer is in no way personally concerned, mandamus to compel action by the officer by way of performance of the state’s' contract cannot be maintained because it is a suit against the state. On the other hand, where the state is the wrongdoer and the officer is proceeding under the unconstitutional mandate of the state, he may, in a proper case, be restrained, notwithstanding the indirect effect of the injunction is to prevent the breach of the state’s contract. ' This is so because the unconstitutional law is no law and leaves the state officer in the position of a wrongdoer. McGahey v. Virginia, 135 U. S. 662, 10 Sup. Ct. 972, 34 L. Ed. 304. The fore*395going distinctions do not exhaust the súbject, but they are correct so far as they go, and are sufficient for our purposes in this case.
It seems clear from the foregoing cases that, if the relator was seeking to compel the commissioner of public lands to execute a deed in accordance with the contract, there would be no difficulty in enforcing the duty by mandamus, because under the provisions of section 5236, Code 1915, it is made the statutory duty of the commissioners, upon payment of the purchase price for the public lands, to immediately issue a deed for the lands so purchased.
As heretofore pointed out, however, this is not what the relator is seeking. He is seeking to compel the commissioner to execute to him a deed conveying the absolute fee without reservation of the mineral rights in the land. If he is to succeed he is compelling the state to part with something which it has never contracted to sell. He is seeking to compel the state, through its only authorized agent, the commissioner, to make a contract with him, and to execute the same, such as it has never agreed to do. The state had a direct, pecuniary, and property interest in the matter involved, and there is no law which can be pointed to making it the official duty of the commissioner to execute the deed as claimed by relator. It seems clear, therefore, that under such circumstances this is a suit against the state of New Mexico to which the state has never given its consent, and which cannot for that reason be maintained.
An argument is presented by counsel for appellee in support of the judgment to the effect that the reservation in the contract of sale was without authority on the part of the commissioner, and is therefore void and of no effect, and does not authorize the commissioner to refuse to him a deed of the absolute fee. The argument proceeds upon the the*396ory that a condition imposed by the executive officers of the land department which is in contravention of, or unauthorized by, law is void, and the purchaser will take his title free from the condition. Counsel relies upon the federal cases, and principally that of Burke v. S. P. R. R. Co., 234 U. S. 696, 34 Sup. Ct. 907, 58 L. Ed. 1527. We do not deem these United States cases as applicable. Whether the commissioner of public lands has power and authority to make the reservation, which he has made in- this case, it is unneecssary for us to determine. If he has not the power, when the purchaser takes a deed with the reservation contained therein, there may arise a question as to the effect of the reservation in some controversy which may arise when the commissioner or some one under him begins to explore for minerals; but mandamus is not a proper remedy to try such a question in a case of this kind where the state itself is involved.
It appears from the record that an oil and gas lease has, subsequent to the tender and demand for deed by relator, been executed to Reed, the other respondent. The same considerations heretofore pointed ■ out control in regard to this lease. Mandamus to cancel this lease cannot be maintained if mandamus to convey without the reservation which contemplates the making of the lease cannot be maintained.
It follows from- the foregoing that the judgment of the court below is erroneous, and should be reversed, and the case remanded, with directions to discharge the writ; and, it is so ordered.
ROBERTS, C. J., and RAYNOLDS, J., concur.