Corson, J.
This is an action to quiet the title to certain town lots in the cityof Deadwood. It is alleged in the complaint, in substance, that the plaintiff, a municipal corporation, and the county judge, are the owners in possession and entitled to the possession of certain town lots therein described, and that the defendants cl aim and assert some estate and interest in and to the' said premises adverse to the plaintiffs. The plaintiffs also allege in their complaint that they claim title to the said property under and by virtue of the entry of the same as a town site in 1878, and confirmed.by patent in 1886, and they pray for judgment that the title of the plaintiffs to said lots may be declared to be perfect and valid, and that the defendants and all persons claiming under them be forever barred from asserting or claiming any interest in the said property, or any part thereof. The defendants, in their answer, admit the entry of the town site of the city of Deadwood, and the issuance of the patent therefor, and that the lots in controversy are within the exterior boundary of the said town site, but deny that the said patent conveyed to or vested any title, either legal or equitable, in the plaintiffs, or either of them, to the said lots embraced or covered by - those certain mining claims or locations designated and described as the “Infant Lode,” the ‘ Caroline Lode,”- the “Yellow Bank Extension Lode,” the General Thomas Francis Maher Lode,” and ohe “Kalamazoo Lode,” all adjoining and situated on the divide be-' tween City creek and Deadwood creek, within the corporate limits of the said city of Deadwood; that at the date of the en*75try for patent for the said town site of Deadwood on or about the 29th day of July, 1878, and long prior thereto, and at the date of the issuance of the patent for the same on November 17, 1886, and at the time of the commencement of this action, all and each of said mining claims contained and were at. said periods known to contain valuable deposits of quartz rock in place bearing gold and silver, and were at each' of said dates and now are known to be valuable for mining purposes, and by reason thereof they and each of the said mining claims were, under the laws of the United States, excluded from such entry and from the grant of such patent. Defendants deny that;said claims and interest of the defendants are junior or inferior to and of no validity as against the title of the plaintiffs, as alleged in their complaint, but allege that the title and interest of these defendants in and to the portions of the premises covered by and included in said mining claims are prior to any . pretended right or title of the plaintiffs, or either of them, in and to the same, or any part thereof. The defendants, in their answer by way of an affirmative defense or counterclaim, after setting out their title to the said mining claims, aver: “That each and all of said mining claims contain valuable veins and lodes bearing gold and other minerals of great richness, and the same were known to exist, were claimed, located and worked, before and at the. time the town site of Deadwood was entered for patent, at the date of the said patent, and at the time this action was commenced. That subsequent to said; entry of said town site said mining claims so located prior to said entry were abandoned, and the ground became abandoned and vacant, subject to relocation as abandoned mining ground.” It is further alleged that the several mining claims were, relocated *76at various dates between April, 1890, and March., 1893, and all the requirements as to such location are fully and in detail set out in the answer, and the defendants pray for judgment that their title to the said mining claims may be quieted in them as against said plaintiffs. To this answer the defendants interposed a demurrer upon the ground that said answer does not state facts sufficient to constitute a defense or counterclaim. This demurrer was sustained, and, the defendants electing to stand upon their answer, a judgment was entered in favor of' the plaintiffs, and from this judgment the defendants have appealed to this court.
For the purposes of this decision we must assume that the facts alleged in the answer are true. It will be observed that by the answer the defendants allege that they are the owners of certain mining claims located by them, their grantors, and predecessors in interest since the entry and patent of the town’ site, but that said mining claims were known to contain valuable deposits of gold-bearing quartz rock, and were claimed, located, worked, and held under the then existing laws prior to and at the time the town site of Deadwood was entered for patent.
The appellants contend: (1) That the answer in this case alleges that the premises in controversy were known to contain valuable deposits of gold-bearing ore before and at the time of the town site entry by the county judge, and that by reason thereof the mining claims in controversy were excluded from the town site patent. (2) That the allegations of the answer clearly show that the mining claims in controversy were located, worked, and held under the then existing laws, as such mining claims, prior to and at the time of such entry, and *77were, therefore, excluded from the town site patent. (8) That the answer sufficiently shows that the defendants, their grantors and predecessors in interest, complied with the mining laws, rules, and regulations in locating said mining claims.
It is insisted by the respondents: (1) That the town site patent cannot be attacked by the defendants, as their rights, if any, in the land, attached after the issuance of the patent, and that it can be assailed only in a direct proceeding by the United States. (2) That, as the defendants’ alleged rights were not initiated until after the issuance of the town site patent, they are not in a position to assail that patent in this collateral proceeding on the ground that the lands embraced within the patent were known to be mineral at the time of patent. *
As we have seen, the town site entry was made July 29, 1878, and the patent issued November 17, 1886. The first mining claim of the defendants was alleged to have been located April 13, 1890, and the last March 7, 1893. While it is alleged in the answer that the mining lodes claimed by the defendants were located prior to the entry of the town site and the issuance of the patent therefor, defendants do not' claim to have succeeded to the rights of any of the older locators,, and they do not plead those former mining locations for the purpose of in any way connecting themselves therewith, but only for the purpose of showing that the land was excepted from the patent. It will be observed, therefore, that the mining claims upon which the defendants predicate their claim of title and right of possession were all located, their boundaries marked, and were recorded long subsequently to the entry of the town site and the issuance of the patent upon said entry. *78The question presented, therefore, is, can a party go upon a patented town site, and locate a mining claim, upon the theory that the ground so located was known to be mineral at the time the town site was entered, and hold the same as against parties claiming title under the town site patent. As we have seen, the appellants contend that this can be lawfully done upon the theory that the ground, being mineral land, was excepted from, and therefore did not pass by virtue of, the town site patent. The town site law contains the following provision: ‘‘No title shall be acquired under the foregoing provisions of this chapter, to any mine of gold, silver, cinnabar, or copper, or to any valid mining claim or possession held under existing laws. ” Rev. St. U. S. § 2392 [U. S. Comp. St. 1901, p. 1459]. The same or similar provisions have been made in most of the grants to railroad companies and homestead and pre-emption laws, and it has been quite uniformly held that the.question of whether or not lands located and held under any of the various provisions of the land laws are mineral lands is to be determined by the land department, to which the administration of land laws has been committed. The officers of the land department, in issuing a patent, must necessarily pass upon the mineral or nonmineral character of the land, and the patent issued by the government can only be attacked by a direct proceeding by or under the direction of the government of the United States. Davis v. Weibbold, 139 U. S. 507, 11 Sup. Ct. 628, 35 L. Ed. 238; Carter v. Thompson (C. C.) 65 Fed. 329; Barden v. Railroad Co., 154 U. S. 288, 14 Sup. Ct. 1030, 38 L. Ed. 992; Mining & Milling Co. v. Spargo (C. C.) 16 Fed. 348: Steel v. Smelting Co. 106 U. S. 447, 1 Sup. Ct. 389, 27 L. Ed. 226; Petroleum Co. v. Tulare Oil and M. Co. (C. C.) 67 Fed. *79226; Horsky v. Moran (Mont.) 53 Pac. 1064; New Dunderberg M. Co. v. Old, 79 Fed. 598, 25 C. C. A. 116.
The facts alleged in the case of Carter v. Thompson, supra, are very analogous to those alleged in the complaint in the case at bar. In that case the plaintiff made the location of a placer claim within the limits of the patented town site of Hel'ena, and there were allegations in his bill that the premises in dispute were mineral lands, and were known to be such at the time and prior to the application to enter such land under the town site law. Plaintiff’s location was made in September, 1893, and the town site patent was issued in June, 1872. The demurrer to the complaint was sustained by the United States district court, and the appeal dismissed. In the opinion sustaining the demurrer thaj court says: “It seems to be claimed that, as the lands were known to be mineral before the application or issuing of the patent, therefore it is void. The question as to whether the land was mineral or not was one upon which the land department passed in issuing the patent to Miers F. Truett, the probate judge.” The court, after reviewing a number of decisions involving this question, says: “The conclusion is that the land granted to Miers F. Truett in trust for the Helena town site must be classed as non-mineral. It was so determined by the land department. This determination cannot be attacked in a collateral proceeding. * • * * If any fraud was practiced, or any mistake of law or fact occurred in issuing the patent to the town site, the complainant cannot take advantage of this. He had no rights at the time to be affected by either the fraud or mistake. ' * * * Complainant, therefore, by his own showing, presents facts to the court which shows that he is not entitled to recover in this *80case.” The case of Davis v. Weibbold, supra, is also, in its facts, quite analogous to the case at bar, although in that case the plaintiffs had acquired a patent for the mining claim located by their intestate. The plaintiffs had recovered judgment in the trial court for the ground claimed by them under their location as against the defendant, who claimed the property under the town site patent of Butte. On appeal to the Supreme Court of Montana this judgment was affirmed, but upon appeal from that court to the Supreme Court of the United States the judgment was reversed. The latter court, in an exhaustive opinion by Mr. Justice Field, goes over the whole subject. In speaking of the jurisdiction of the land department of the government, the court says: “It would seem, from this uniform construction of that department of the government specially intrusted with the supervision of proceedings required for the alienation of the public lands, including those that embrace minerals, and also of the courts of the mining states, federal and state, whose attention has been called to the subject, that the exception of mineral lands from the grant in the acts of Congress should be considered to apply only to such lands as were at the time of the grant known to be so valuable for their minerals as to justify expenditure for their extraction. The grant or. patent, when issued, would thus be held to carry with it the determination of the proper authorities that the land patented was not subject to the exception stated. There has been no direct adjudication upon this point by this court, but this conclusion is a legitimate inference from several of its decisions. It was implied in the opinion in Deffeback v. Hawke [115 U. S. 392, 6 Sup. Ct. 95, 29 L. Ed., 423,] already referred to, and in the cases of the Colorado Coal *81& Iron Co. v. United States, 123 U. S. 307, 328 [8 Sup. Ct. 131, 31 L. Ed. 182], and United States v. Iron Silver Mining Co., 128 U. S, 673, 683 [9 Sup. Ct. 195, 32 L. Ed. 571].” Again the court says: “The laws of Congress provide that valuable mineral deposits in lands of the United States shall be open to exploration and purchase. They do not provide, and never have provided, that such mineral deposits in lands which have ceased to be public, and become the property of private individuals, can be patented under any proceedings before the land department or otherwise * * * But it is not perceived where the jurisdiction exists under the laws of the United States to grant a patent for a mine on lands owned by private individuals — which was the case here — if the lots for -which the defendant received a deed were included within the town site patent, and the location of the mining claim was subsequently made. Nor is there in this statement anything at all inconsistent with the decision of this court in Steel v. Smelting Co., 106 U. S. 447 (1 Sup. Ct. 389, 27 L. Ed. 226.) * * * We were speaking at that time of town sites for which no patent had been issued, and of mines'in public lands. x * * Valuable mineral deposits in such lands outside of the patent are equally open to exploration and purchase as those in the lands outside. It was in reference to mines in unoccupied public lands in unpatented town sites that the language in Steel v. Smelting Co. was used, and to them and to mines in public lands in patented town sites outside of the limits of the patent it is only applicable. We aeree to all that is urged by counsel as to the conclusiveness of the patents of the land department when assailed collaterally in actions at law. We have had occasion to assert their unassailibility in such cases in the strongest terms, both *82in Smelting Co. v. Kemp, 104 U. S, 636, 640-646 [26 L. Ed. 875] and In Steele v. Smelting Co., 106 U. S. 447, 451 452 [1 Sup. Ct. 389, 27 L. Ed. 226].” It will thus be seen that there is nothing in the opinion in the case of Deffeback v. Hawke, 115 U. S. 392, 6 Sup. Ct. 95, 29 L. Ed. 423, and the cases above mentioned, as explained by the court, that supports the theory of the appellants. In Barden v. Railroad Co., 154 U. S. 288, 14 Sup. Ct. 1030, 38 L. Ed. 992, the Supreme court of the United States says: “It is this established doctrine, expressed in numerous decisions of the court, that wherever Congress has provided for the disposition of any portion of the public lands of a particular character, and authorizes the officers of the land department to issue a patent for such land upon ascertainment of certain facts, the department has jurisdiction to inquire into and determine as to the existence of such facts, and, in the absence of fraud, imposition, or mistake, its determination is conclusive against collateral attack ” It is quite clear therefore, that the appellants were not authorized to locate the ground in controversy, and that they failed in their answer to state facts sufficient to constitute a defense to the action of the plaintiffs.
The patent to the Deadwood town site passed the entire title as against any subsequent locators, and the patent cannot be attacked collaterally in this action. The land officers were charged with the duty of ascertaining whether the lands were subject to be patented as a town site, and their determination is conclusive, at least in this action. As is said by the Supreme Court of the United States in Davis v. Weibbold, supra, no provision has been made for the location of valuable mineral deposits in lands which have ceased to be public, and *83which have become the property of private parties under any proceedings, under the land department or otherwise. Any other construction would be disastrous in the extreme to the holders of property under a town site patent. If lands which a party has actually and peacefully enjoyed, claiming title under a town site patent, can be entered upon and prospected for a mine by any parties who choose to do so upon the theory that such property was known to contain valuable deposits of mineral-bearing rock before the patent was issued and the land can he located, the patent, instead of being a muniment of title upon which the patentee or his grantees can rely in security, would be a delusion and a snare.
We are of the opinion therefore, that the circuit court was right in sustaining the demurrer, and the judgment and order-s of that court are affirmed.