(after stating the facts as above). In the case of United States v. Stanford (C. C.) 69 Fed. 25, 38, in speaking of grants made by Congress in aid of the building of the transcontinental railroads, which, by reason of the circumstances under which they were undertaken and constructed, became national in character, the court said:
“The terms and conditions of those grants are to be ascertained by a resort to the statute. Having been duly accepted by the railroad companies in question, they constitute the contract between the respective parties, from which the companies cannot depart, and which the government cannot change or alter except in the mode reserved to it by law. If, upon so elementary a proposition, authority is needed, it may be found in the decision in the Sinking Fund Oases, 99 U. S. 718, 719 L25 L. Ed. 496J, and in Union Pac. R. Co. v. U. S., 104 U. S. 663 [26 L. Ed. 884].”
That decision was rendered January 29, 1895, and was affirmed by the Supreme Court. 161 U. S. 412, .16 Sup. Ct. 576, 40 L. Ed. 751.
The same contractual relations that arose between the government and the grantee companies were subsequently declared in numerous decisions of the Supreme Court. It is enough to refer upon that point to the late case of Burke v. Southern Pacific Railroad Co., 234 U. S. 669, at page 679, 34 Sup. Ct. 907, at page 911 (58 U. Ed. 1527), where the court said:
“We first notice a contention, advanced on the part of the mineral claimants, to the effect that the grant to the railroad company was merely a gift from the United States, and should be construed and applied accordingly. The granting act, not only does not support the contention, but refutes it. The act did not follow the building of the road, but preceded it. Instead of giving a gratuitous reward for something already done, the act made a proposal to the company to the effect that, if the latter would locate, construct, and put into operation a designated line of railroad, patents would be issued to the company, confirming in it the right and title to the public lands falling with*903in the descriptive terms of the grant. The purpose was to bring about tho construction of the road, with the resulting advantages to the government and tho public, and to that end provision was ipade for compensating tho company, if it should do the work, by patenting to it the lands indicated. Tho company was at liberty to accept or reject the proposal. It accepted in the mode contemplated by the act, and thereby the parties wore brought into such contractual relations that tho terms of the proposal became obligatory on both. Menotti v. Dillon, 167 IT. S. 706, 721 117 Sup. Ot. 945, 42 L. Ed. 3331. And when, by constructing the road and putting it in operation, the company performed its part of the contract, it became entitled to performance by the government. In other words, it earned the right to tho lands described. Of course, any ambiguity or uncertainty in the terms employed should be resolved in favor of the government, but tho grant should not be treated as a mere gift.”
The grant under which the Northern Pacific Railroad Company, predecessor in interest of the present appellee, constructed that road and earned its grant, was made by Act of Congress of July 2, 1864 (13 Stat. 365), sections 3, 4, and 6 of which are as follows:
“Sec. 3. And be it further enacted, that there be, and hereby is, granted to the ‘Northern Pacific Railroad Company,’ its successors and assigns, for tho purpose of aiding in the construction of said railroad and telegraph line to tho Pacific Coast, and to secure the safe and speedy transportation of the mails, troops, munitions of war, and public stores, over tho route of said line of railway, every alternate section of public, land, not mineral, designated by odd numbers, to the amount of twenty alternate sections per mile, on each side of said railroad line, as said company may adopt, through the territories of the United States, and ten alternate sections of land per mile on each side of said railroad whenever it passes through any state, and whenever on the line thereof, the United States have full title, not reserved, sold, granted, or otherwise appropriated, and free from pre-emption, or other claims or rights, at the time the line of said road is definitely fixed, and a plat thereof filed in the office of the Commissioner of tho General Land Office; and whenever, prior to said time, any of said sections or parts of sections shall have been granted, sold, reserved, occupied by homestead settlers, or pre-empted, or otherwise disposed of, other lands shall be selected by said company in lieu thereof, under the direction of the Secretary of the Interior, in alternate sections, and designated by odd numbers, not more than ten miles beyond the limits of said alternate sections: Provided, that if said route shall be found upon tho line of any other railroad route to aid in the construction of which lands have been heretofore granted by ihe United States, as far as the routes are upon the same general line, the amount of land heretofore granted shall be deducted from the amount granted by this act: Provided, further, that the railroad company receiving the previous grant of land may assign their interest to said ‘Northern Pacific Railroad Company,’ or may consolidate, confederate, and associate with said company upon the terms named in the first section of this act: Provided, further, that all mineral lands he, and the same are hereby, excluded from the operations of this act, and in lieu thereof a like quantity of unoccupied and unappropriated agricultural lands, in odd numbered sections, nearest to the line of said road [and within fifty miles thereof,! may be selected as above provided: And provided, further, that the word ‘mineral,’ when it occurs in this act, shall not be held to include iron or coal": And provided, further, that no money shall be drawn from the treasury of the United States to aid in tho construction of the said ‘Northern Pacific Railroad.’
“Sec. 4. And be it further enacted, that whenever said ‘Northern Pacific Railroad Company’ shall have twenty-five consecutive miles of any portion of said railroad and telegraph line ready for the service contempla! ed, the President of the United States shall appoint three commissioners to examine the same, and if it shall appear that twenty-five consecutive miles of said road *904and telegraph line have been completed in a good, substantial, and workmanlike manner, as in all other respects required by this act, the commissioners shall so report to the President of the United States, and patents of lands, as aforesaid, shall be issued to said company, confirming to said company the right and title to said lands, situated opposite to, and coterminus with, said completed section of said road; and, from time to time, whenever twenty-five additional consecutive miles shall have been constructed, completed, and in readiness as aforesaid, and verified by said commissioners to the President of the United States, then patents shall be issued to said company conveying the additional sections of land as aforesaid, and so on as fast as every twenty-five miles of said road is completed as aforesaid: Provided, that no more than ten sections, of land per mile, as said road shall be completed, shall be conveyed to said company for all that part of said railroad lying east of the western boundary of the state of Minnesota, until the whole of said railroad shall be finished and in good running order, as a first-class railroad, from the place of beginning on Lake Superior to the western boundary of Minnesota: Provided, also, that lands shall not be granted under the provisions of this act on account of any railroad, or part thereof, constructed at the date of the passage of this act.”
“Sec. 6. And be it further enacted, that the President of the United States shall cause the lands to be surveyed for forty miles in width on both sides of the entire line of said road, after the general route shall be fixed, and as fast as may be required by the construction of said railroad; and the odd sections of land hereby granted shall not be liable to sale, or entry, or pre-emption before or after they are surveyed, except by said company, as provided in this act: but the provisions of the act of September, eighteen hundred and forty-one, granting pre-emption rights, and the acts amendatory thereof, and of the act entitled ‘An act to secure homesteads to actual settlers on the public domain,’ approved May tweñty, eighteen hundred and sixty-two, shall be, and the same are hereby, extended to all other lands on the line of said road, when surveyed, excepting those hereby granted to said company. And the reserved alternate sections shall not be sold by the government at a price less than two-dollars and fifty cents per acre, when offered for sale.”
By its subsequent act of May 31/ 1870 (16 Stat. 378), Congress by joint resolution enlarged that grant, and also empowered the grantee to mortgage tire property — the resolution being as follows:
“Resolved by the Senate and House of Representatives of the United States of America in Congress assembled, that the Northern Pacific Railroad Company be, and hereby is, authorized to issue its bonds to aid in the construction and equipment of its road, and to secure the same by mortgage on its property and rights- of property of all kinds and descriptions, real, personal, and mixed, including its franchise as a corporation; and, as proof and notice of its legal execution and effectual delivery, said mortgage shall be filed and recorded in the office of the Secretary of the Interior; and also to locate and construct, under the provisions and with the privileges, grants, and duties provided for in its act of incorporation, its main road to some point on Puget Sound, via the valley of the Columbia river, with the right to locate and construct its branch from some convenient point on its main trunk line across the Cascade Mountains to Puget Sound; and in the event of there not being in any state or territory in which said main line or branch may be located, at the time of the final location thereof, the amount of lands per mile granted by Congress to said company, within the limits prescribed by its charter, then said company shall be entitled, under the directions of the Secretary of the Interior, to receive so many sections of land belonging to the United States, and designated by odd numbers, in such state or territory, within ten miles on each side of said road, beyond the limits prescribed in said charter, as will make up such deficiency, on said main line or branch, except mineral and other lands as excepted in the charter of said company of eighteen hundred and sixty-four, to the amount of the lands that have been granted, sold, re*905served, occupied by homestead settlers, pre-empted, or otherwise disposed of subsequent to the passage of the act of July two, eighteen hundred, and sixty-fonr. And that twenty-live miles of said main line between its western terminus and the city of Portland, in ihe slate of Oregon, shall be eomi>letod by Hie first day of January, Anno Domini eighteen hundred and seventy-two. and forty miles of the. remaining portion thereof each year thereafter, until the whole shall he completed between said points: Provided, that all lands hereby granted to said company which shall not be sold or disposed of or remain subject to the mortgage by this act authorized, at the expiration of live years after the completion of the entire road, shall be subject to settlement and preemption like other lands, at a price to be paid to said company not exceeding two dollars and fifty cents per acre; and if the mortgage hereby authorized shall at any time bo enforced by foreclosure or other legal proceeding, or the mortgaged lands hereby granted, or any of them, be sold by the trustees to whom such mortgage may be executed, either at its maturity or for any failure or default of said company under the terms thereof, such lands shall ho sold at public; sale, at places within the states and territories in which they shall be situate, after not less than sixty days’ previous notice, in single sections or subdivisions thereof, to the highest and best bidder: Provided further, that in the construction of the said railroad, American iron or steel only shall be used, the same to be manufactured from American ores exclusively.
‘‘See. 2. And be it further resolved, that Congress may at any time alter or amend this joint resolution, having due regard to the rights of said company, and any other parties.”
It is well settled that granted lands, such as referred to in the sections above quoted, are those within the place limits. Hewitt v. Schultz, 180 U. S. 139, 146, 21 Sup. Ct. 309, 45 R. Ed. 463; United States v. Northern Pacific Railroad, 152 U. S. 284, 296, 14 Sup. Ct. 598, 38 R. Ed. 443; Northern Pacific Railroad v. Sanders, 166 U. S. 620, 634, 635, 17 Sup. Ct. 671, 41 R. Ed. 1139; and United States v. Oregon & California Railroad, 176 U. S. 28, 42, 20 Sup. Ct. 261, 44 R. Ed. 358, and authorities there cited. And it being conceded by the counsel for the appellee herein that prior to the selection of any land within the indemnity limits of the grant under which the appellee claims, in lieu of losses within its primary limits, all lands within such indemnity limits were and are open to all persons claiming under the general land laws prior to selection by the railroad company of such indemnity lands, it becomes unnecessary to cite the very numerous decisions of both the Supreme Court and the subordinate courts to that effect.
The real question here is, as we think, whether a court of equity should sustain the government in its attempt to appropriate to its own purposes, to wit, for a public park, land that fey its solemn contract it agreed the Northern Pacific Railroad Company should receive for corfipletiug its road, which it is conceded ft did complete in performance of its part of the agreement. It appears from the stipulation of the parties that the lands in controversy are nonmineral and situated in the Bozeman land district in the state of Montana, and within -SO miles of and more than 40 miles from the line of the appellee’s railway and opposite that portion thereof which was definitely located July 6, 1882; that January 29, 1904, under the authority and by the direction of the President and the Secretary of the Interior, the Commissioner of the General Rand Office temporarily withdrew from entry, sale, and other forms of disposal excepting under the mineral land *906laws, a certain area within the exterior boundaries of which the lands in controversy are situated, which order of withdrawal was duly transmitted to and received by the register and receiver of the local land district in which the lands are situated; that such withdrawal was made pending determination as to the desirability of including the lands so withdrawn within Gallatin Forest Reservation, and that by proclamation issued March 7, 1908, the President included the said area so withdrawn within said reservation, the name of which was subsequently changed by executive order of date July 1, 1908. It is further stipulated that at the time the said order of withdrawal was made the lands in controversy had not been officially surveyed and were not so surveyed until April 5, 1905, on which date the appellee filed in the local land office at Bozeman its indemnity selection list No. 120, whereby it applied to select the lands involved in this suit in lieu of mineral lands within the place limits of its grant, and it is conceded that in pursuance of such selection the patent sought by this suit to be canceled was issued — the government insisting that in doing so the Rand Department overlooked the said withdrawal order of January 29, 1904. It is further agreed by the respective parties that the ap-pellee was entitled to make such indemnity selection, unless the said order of withdrawal was sufficient under the law to withdraw the said indemnity lands from such selection.
The case of Hewitt v. Schultz, supra, among others that might readily be cited, clearly shows that for many years, and until the decision of Secretary Vilas in the case of Northern Pacific Railroad Company v. Miller, 7 Land Dec. 100, in 1887, it was the practice of the Department of the Interior to withdraw from sale or entry under the general land laws such indemnity' lands on the filing by the railroad company of its map showing the location of its general route. That decision of the Secretary, which in effect held that the grant to the Northern Pacific Railroad Company forbade the Land Department to withdraw prior to survey from the operation of the pre-emption and homestead laws any lands within the indemnity limits of the grant, was approved by the Supreme Court in the Hewitt-Schultz Case, Justices Brewer and Shiras dissenting; the court, near the conclusion of its opinion (180 U. S. 156, 157, 21 Sup. Ct. 315, 45 L- Ed. 463), saying:
“It was'admitted at the hearing that the construction of the Northern Pacific Act of 1864 announced by Secretary Vilas had been adhered to in the administration of the public lands by the Land Department. We are now asked to overthrow that, construction by holding that it was competent for, the Land Department, immediately upon the definite location of the line of' the railroad, to withdraw from the settlement laws all the odd-numbered sections within the indemnity limits as defined by the act of Congress. If this were done it is to be apprehended that great, if not endless, confusion would ensue in the administration of the public lands, and that the rights of a vast number of people who have acquired homes under the pre-emptioii and homestead laws, in reliance upon the ruling of Secretary Vilas and his successors in office, would be destroyed. Of course, if the ruling of that office was plainly erroneous, it would be the duty of the court to give effect to the will of Congress ; for it is the settled doctrine of this court that the practice of a department in the execution of a statute is material only when doubt exists as to its true construction, But, without considering the matter as if it were for the *907first timo presented, it is sufficient to say tliat the question before ns cannot bo said to be free from doubt. The intention of Congress bas not been so clearly expressed as to exclude construction or argument in support of the view taken by Secretaries Lamar, Vilas, and Smith, and upon which the Land Department has acted since 1888. ‘It is the settled doctrine of this court,’ sis was said in United States v. Alabama Great Southern Kailroad, 142 U. S. 015, 021 L12 Sup. Ct. 300, 308 (35 L. Ed. 1134)J. ‘that, in case of ambiguity, the judicial department will lean in l'avor of a construction given to a statute by the department charged with the execution of such statute, and, if such construction lie acted upon for a number of years, will look with disfavor upon any sudden change, whereby parties who have contracted with the government upon the faith of such construction may be prejudiced.’ These observations apply to the case now before us, and lead to the conclusion that if the practice in the Land Department could with reason be held to have been wrong, it cannot bo said to have been so plainly or palpably wrong as to justify the court, after the lapse of so many years, in adjudging that it had misconstrued the act of July 2, 1804.”
The law has therefore long been thoroughly settled, not only that the Northern Pacific Railroad Company acquired no right to any specific tract of land within the indemnity limits of its grant prior to the survey thereof and its selection by the company, but that neither the Secretary of the Interior, the Commissioner of the General Rand Office, nor any other officer of the government was authorized to withdraw for the benefit of the railroad company any of such indemnity lands prior to their survey, from settlement or entry under the general land laws. But that, in our opinion, is a wholly different thing from holding or in any way implying that any officer of the government was authorized to withdraw any of such indemnity lands for the purposes of the government itself, in violation of the solemn contract made by Congress in its acts above referred to, which, as we have before observed, is the real question in this case.
. By act of Congress of March 3, 1887 (24 Stat. 556), the Secretary of the Interior was directed to immediately adjust, in accordance with the decisions of the Supreme Court, each of the railroad land grants made by Congress to aid in the construction of railroads and theretofore unadjusted. That there was found such a deficiency of granted lands within the primary limits of the grant in question as entitled the railroad company to look to the indemnity lands in lieu thereof we think clearly appears, not only from the agreed statement of facts upon which the case was tried, but from the fact of the issuance by the Rand Department of the patent sought by this suit to he canceled, not by reason of the fact that it was issued for indemnity land in lieu of land lost to the railroad company within the primary limits of its grant, but because of the withdrawal order of January 29, 1904. In the case of St. Paul & Pacific Railroad Co. v. Northern Pacific Railroad Co., 139 U. S. 1, 19, 11 Sup. Ct. 389, 395 (35 R. Ed. 77) the court very carefully considered the act of July 2, 1864, and concluded its unanimous opinion in these words:
“As to the objection that no evidence was produced of any selection by the Secretary of the Interior from the indemnity lands to make up for the deficiencies found in the lands within the place limits, it is sufficient to observe that all the lands within the indemnity limits only made up in part for these *908deficiencies. There was, therefore, no occasion for the exercise of the judgment of the Secretary in selecting from them, for they were all appropriated.”
In Wisconsin Central Railroad Co. v. Forsythe, 159 U. S. 46, 60, 15 Sup. Ct. 1020, 1025 (40 R. Ed. 71), the same court said:
“When Congress makes a grant of a specific number of sections in aid of any work of internal improvement, it must be assumed that it intends the beneficiary to receive such amount of land, and when it prescribes that those lands shall be alternate sections along the line of the improvement, it is equally clear that the intent is that if possible the beneficiary shall receive those particular sections. So far as railroads are concerned, it is the thought not merely that the general welfare will be subserved by the construction of the road along the lines indicated, but further, that such grant shall not be attended with any pecuniary loss to the United States; for the universal rule is to double the price of even sections within the granted limits. The expectation is that the company receiving the odd sections will take pains to dispose of them to settlers, and thus by their .settlement and improvement increase the value of the even sections adjoining and so justify the added price. To fully realize this expected benefit it is essential that the lands taken by the company shall be as near to the line of the road as possible; and so, while selection of remote lands is permitted, it is only when and because there is a nec-' essity of such selection to make good the amount of the grant. Obviously, therefore, an act must be construed to realize, so far as is possible, this .intent and to accomplish the desired result.”
In Southern Pacific Railroad Co. v. Bell, 183 U. S. 675, 689, 22 Sup. Ct. 232, 237 (46 R. Ed. 383), the court said:
“Now, as already observed, there is a clear distinction in section 3 between granted lands and lands to be selected after the deficiency in the granted lands has been ascertained. It is true that, prior' to this selection being made, many of these indemnity lands may be taken up, and an insufficient, amount left for the railroad (and we do not deny the force of the dissenting opinion in Hewitt v. Schultz in that connection) ; but we think this possibility serves rather as a basis for a further action by Congress, such as was made in the Northern Pacific Case by the joint resolution of May 31, 1870 (16 Stat. 378), than as a reason for withdrawing from settlement a vast amount of land which the railroad may never have occasion to require.”
In Oregon & California Railroad Co. v. United States, 189 U. S. 103, 115, 23 Sup. Ct. 615, 620 (47 R. Ed. 726), the court further observed :
“It is also said that all the lands within the indemnity limits were required to supply the deficit in place limits arising from the disposition prior to definite location by sale and otherwise of lands within the granted limits. But the extent to which lieu lands could be required to supply such deficit in place lands could not be properly or legally determined until there was an adjustment of the grant of lands in respect of place limits.”
And in Humbird v. Avery, 195 U. S. 480, 507, 508, 509, 25 Sup. Ct. 123, 132 (49 R. Ed. 286), the court, after referring to its preceding decision in Wisconsin Cent. R. Co. v. Price' County, 133 U. S. 496, 10 Sup. Ct.'341_, 33 R. Ed. 687, to the effect that the indemnity lands remained unaffected by the grant until selection, and that “until then, the lands which might be taken as indemnity were incapable of identification; the proposed selections remained the property of the United States. The government was, indeed, under a promise to give the company indemnity lands in lieu of what might be lost by the causes mentioned. But such promise passed no title, and, until *909it was executed, created no legal interest which could be enforced in the courts”- — said:
“Now, the lands here in dispute and claimed by the plaintiffs as grantees of the Northern Pacific Railway Company (the alleged successor in interest of the Northern Pacific Railroad Company) are lands admittedly within indemnity, as distinguished from granted or place, limits. The mere filing of lists of selections, after the acceptance of the map of definite location of the railroad line between Duluth and Ashland, gave the company no such title as could be enforced by the courts in a suit between private parties. It is true the government was under a promise to give the railroad company lands in the indemnity limits to supply losses in place limits. But, as adjudged in the above cases, that' promise passed no title. The promise will no doubt be fulfilled by the government in due time, and in its own way. The selections not having been approved by the Secretary, the title remains in the government.”
That promise of the government of indemnity lands in lieu of what might be lost in the place limits was an essential part of the contract between the government and the Northern Pacific Railroad Company for the building of the road it did build, the compliance with which contract on its part clearly precludes, in our opinion, the government from subsequently taking such lands for other purposes of its own.
The judgment is affirmed.