This case is brought to settle the conflicting claims of the plaintiff and defendant to the ownership of the southwest quarter of section 5, township 95, range 42 W., of 5th P. M., situated in O’Brien county, Iowa, which land's were within the limits of the grant made by congress to the state of Iowa under date of May 12, 1864, of certain lands to aid in the construction of a line of railway from the Minnesota state line to the city of Sioux City, Iowa, and the case is one of the class which is described iri the opinion given by this court in Manley v. Tow, 110 Fed. 241, to which reference may be made for a more full statement of the history of the title to the lands which fall within the category of those which, although within the limits of the grant named in the act of congress of 1864, were never conveyed to the Sioux City & St. Paul Railroad Company by the state of Iowa, for the reason that the railway company never completed the line of railroad beyond the town of Le Mars, Iowa, and which, by the ruling and decision of the supreme court in the case of Sioux City & St. P. R. Co. v. U. S., 159 U. S. 349, 16 Sup. Ct. 17, 40 L. Ed. 177, were declared to be unearned lands, and which, by the terms of the act of 1864, reverted to the United States. It having beem decided in that case that the lands in dispute, with others, had not been earned by the railroad company, but had reverted to the United States, the commissioner of the general land office, by a letter dated November 18, 1893, addressed to the officers of the local land office at Des Moines, notified them that these lands were subject to disposal by the land department, and directed notice thereof to be given, naming a day when entries of the land might be made, and claimants could present their claims for hearing and adjustment. *409Pursuant to this notice, the complainant appeared before the land office at De's Moines, and made proof to the effect that in March, 1884, he was a citizen of the United States, and qualified to make an entry of land under the homestead laws of the United States, and that he had then duly tendered to the proper officers at Des Moines, Iowa, a homestead application for the land in dispute, with the money to pay the legal and necessary fees, but which application was refused by the officers to whom it was tendered, and at that time, to wit, March 10, 1896, the complainant again tendered his homestead application, with the legal fees, and averring that since the date of his original entry upon the land he had continued in possession thereof, residing thereon, and cultivating the premises as his home. At this hearing the defendant, H. C. Lane, appeared and asserted a claim to the land as the assignee and owner of a written contract of sale and purchase executed under date of October 13, 1888, between the Sioux City & St. Paul Railroad Company and one Edward C. Brown of the land in question. The contest thus initiated over the right to the land was set down for hearing before the register and receiver at Des Moines on June 12, 1896, and the contestants were heard, and on April 6, 1897, a decision awarding the land to the complainant under his homestead entry and claim was made, and on appeal to the commissioner of the general land office this decision was affirmed, but on a further appeal to the secretary of the interior this decision was reversed, the land being awarded to the defendant H. C. Lane, and a patent therefor dated April 9, 1901, was in due time issued to the defendant. The conclusion of the secretary of the interior was based upon the construction placed by him upon the provisions of the act of congress of March 3, 1887, and found in the opinion filed by the secretary in the case of Tow v. Manley under date of February 16, 1900 (29 Land Dec. Dep. Int. 504). The facts upon which the decision of the 'secretary of the interior was based are recited in the opinion of the commissioner of the general land office, as follows:
“The testimony is to the effect that E. O. Brown purchased this land under contract from the Sioux City & St. Paul Railroad Company October 13, 1888, and assigned his contract November 13, 1888, to H. C. Lane, the present claimant; that neither of the parties ever took possession of the land or made any improvements upon it; that he paid in all $045.40 on the purchase; that he had the hearsay knowledge of others respecting the company’s title to the land; that he did not inquire when purchasing as to who, if any one, was living on the land; says that Knepper, through whom the purchase was made, may have told him that Benner was living on it and might buy it; presumes he did so tell him; that Benner settled on the land in March, 1884, built a house, barn, and sheds, and broke a part of the tract, and has resided on it continuously since that time; that in February, 1884, he made a homestead application for the tract, which was rejected and returned to him; that he has now 133 acres in cultivation, which, with his other improvements, are worth $1,300 or $1,400; and that he is residing on the land with his family.”
In the opinion filed by the secretary of the interior, in the form of a communication addressed to the commissioner of the general land office, it is said:
“The record, history, and the facts in the case are substantially as stated by your office, and will not be recited here.”
*410Construing the provisions of section 4 of the act of March 3, 1887 {24 Stat. 557), as applicable to the facts recited in the opinion of the commissioner, the secretary held that by the proper construction of that act the rights and equities of the defendant, Lane, based upon the purchase from the railroad company, were superior to those of the complainant, Benner, and directed the issuance of the patent to him.
The question presented for the consideration of the court is whether the secretary rightly construed the provisions of the act of 1887 in thus preferring the equities of the purchaser over the pre-existing equities of the homesteader.
In the opinion given by this court in Manley v. Tow, no Fed. 241, when that case was submitted on demurrer, it was held that the. rights intended to be conferred upon purchasers from railway companies by the provisions of section 4 of the act of 1887 were to be limited to the persons who had purchased unearned lands before the date of the act, and that it should not be so construed as to confer the right to purchase such unearned lands after the date when congress had undertaken, by the adoption of that act, to enforce the forfeiture of the unearned lands and to secure their reversion to the United States. Since the rendition of the opinion in Manley v. Tow, the supreme court in the case of U. S. v. Southern Pac. R. Co., 22 Sup. Ct. 285, 46 L. Ed. 425, has given a construction to the acts of February 12, 1887, and March 2, 1896, and holds that section 4 of the act of 1887 is not to be restricted to purchases made before the adoption of that act, but will include transactions had before the final adjustment of the particular grant under the general provisions of the act. In the opinion filed in the cited case it is expressly stated that the question decided was one wholly between the government and the purchaser from the railway company, as no third party was claiming title thereto, and the court cites its prior decision in the case of Winona & St. P. R. Co. v. U. S., 165 U. S. 483, 17 Sup. Ct. 381, 41 L. Ed. 798, as a correct construction of the statute. In that case it was said:
“It is essential to the protection of these statutes that the party purchasing from the railroad company has no notice by any fact subsequent to and independent of the certification or patent of any defect in title. Such a purchaser cannot claim to be one in good faith if he has notice of facts outside the records of the land department disclosing a prior right. The protection goes only to matters anterior to the certification and patent. The statute was not intended to cut off the rights of parties continuing after the certification, and of which at the time of his purchase the purchaser had notice. Only the purely technical claims of the government were waived.”
As I construe these rulings of the supreme court in these cases, the meaning thereof is that in the settlement and readjustment of the railroad land grants, as provided for in the acts of congress under consideration, it is the legislative intent that the government should act liberally with all persons who had in good faith purchased portions of the unearned lands from the railroad companies, and that the absolute or so-called technical right of the government to insist upon the restoration to the public domain of all lands not earned *411by the railway company under the terms of the grant to it would be waived in favor of good-faith purchasers from the railway company, but that it i's not the intent of these acts to declare that the equities and rights of third parties shall be disregarded in favor of such purchasers. In other words, when the issue is between individual claimants it was not the legislative intent to declare that purchasers from the defaulting railway companies of unearned lands should be favored over other good-faith claimants without regard being paid to the actual equities of such parties, but, on the contrary, in each case the respective rights of such contesting claimants should be settled according to well established and recognized rules of equity and public policy.
What, then, were the respective rights and equities of these claimants when their claim's to the land were submitted to the land department for determination? The complainant, Benner, based his claim upon an offered homestead entry tendered to the proper local land office in February, 1884, followed by open, actual, and continued possession by claimant from that date, with cultivation of the land, the erection of homestead buildings, and the occupancy thereof by the claimant and his family, with a renewal of his homestead entry after the land department had declared the lands to be open to disposal by the department.
But it is said in argument that Benner cannot be deemed to be a homesteader in good faith, because at the time he entered upon the land it was part of the lands granted to the state of Iowa to aid in the construction of a line of railway, and therefore Benner can assert no right or equity based upon an entry and occupancy made under said circumstances. Answering a similar contention advanced in the case of Iron Co. v. Cunningham, 155 U. S. 354, 15 Sup. Ct. 103, 39 L. Ed. 183, the supreme court said:
“But it is said by counsel for the company that it was not a bona fide homestead claim, because at the time the defendant entered upon the land he understood that it was a part of a railroad grant. * * * If he did, he knew that this railroad grant had been outstanding thirty-two years, that the land was to be restored to the government if the road was not completed within ten years, and that twenty-two years had passed since the time fixed by congress for the completion of the road, and nothing had been done. His expectation was (and, under the circumstances, not an unreasonable one) that congress would at some near time interfere to remove all this outstanding claim. Under those circumstances, and in expectation of such removal, he enters upon the land. Oan it be said that this entry and occupation was with the view of depriving anybody of title, or that it was, as against the company, a wrongful entry? If the construction contended for were accepted, it would exclude from the benefit of the act any settler upon these lands who knew that the land he entered upon was within a railroad grant. But legislation respecting the public lands is to be construed favorably to the actual settler, and the construction contended for by the canal company seems to us too narrow. If a party entering upon a tract, although he knew that it was within the limits of an old railroad grant, did so under the honest belief and expectation that the grant, if not technically extinguished by lapse of time, had remained so. long unappropriated by any beneficiary that congress would shortly resume it, and in that belief determined to make for himself a home thereon, with a view of perfecting his title under the land laws of the United States when the forfeiture should be finally declared, it must be held, we think, that he is, within the terms of this confirmatory act, a bona fide claimant of a homestead.”
*412Under the rule thus announced, it is clear that Benner’s home'stead claim was one made in good faith, and sustained, as it has been, by continued occupancy and cultivation of the land, it was an entry and occupancy which, so far as the United States is concerned, would entitle him to secure the premises as a home when the land in question was restored to the public domain. The officers of the local land office and the commissioner of the general land office held that Benner' was entitled to the land as a homestead, and the secretary of the interior did not hold to the contrary, except in that he held that the purchasers from the railway company had the superior right, and it is certainly clear that if Lane had not asserted a right to the land, based upon his purchase from the railway company, Benner’s right under his homestead claim would have been recognized and protected.
Do the facts afford any foundation for the claim of superiority in equity or right on part of the purchaser ? When Benner entered upon possession of the land in furtherance of his homestead claim, which was in the spring of 1884, the ten years allowed to the railway company for the construction of the entire line of railway by the act of congress of 1864 had long since expired, as well as the additional five years allowed to the state of Iowa to secure the completion of the road. The railway company had constructed the line to Le Mars, but no further, and had ceased all work of construction in 1872, twelve years before Benner made his entry, and the lands upon which he entered had never been patented to the company, and laid wholly unoccupied. As is said by the supreme court in the Cunningham Case, supra: “Can it be said that this entry and occupation was with the view of depriving anybody of title, or that it was, as against the company, a wrongful entry?” If the railway company had established a right to the land under the term’s of the grant, such an entry would not be available against it, and Benner made his entry upon the theory that the company had failed to earn the land, and that it would revert to the public domain. As the company has not in fact earned the land, and has not established a title thereto- under the terms of the grant, it has no cause of complaint against Benner for his undertaking to create a homestead on the premises. There is no.ground for holding that as-against the United States the entry was wrongful or fraudulent, and there is none for holding that the entry was in wrong of the company, for such entry would only become of value to Benner in case the company failed to establish a right to the land under the terms of the grant. It is now settled that the company never became the owner of the land by reason of its failure to complete the line of railway to Sioux City, a failure which had happened years before Benner made his entry, and therefore when it was made in the spring of 1884.it cannot be said that it was not made in good faith, or that it was in fraud of the rights of either the United States or of the railway company; and certainly it was not in fraud of the rights ■ of Lane as a purchaser, for the original contract of sale on part of tüe railway company, which was assigned to the defendant, Lane, was not entered into until in October, 1888, or more than four years after Benner had entered upon the land.
The equity and right asserted by the complainant is based, there*413fore, upon a bona fide effort to create a homestead on the land under the provisions of the homestead laws of the United States,—a purpose which has always been regarded with favor hitherto by all branches of the government; for, as is said in Clements v. Warner, 24 How. 397, 16 L. Ed. 695: “The policy of the federal government in favor of settlers upon public lands has been liberal. It recognizes their superior equity to become purchasers of a limited extent of land, comprehending their improvements over that of any other person.” Clearly, therefore, Benner has an equity to which due consideration must be given, and which, under the settled policy of the government, entitles him to have the land awarded him as a homestead, unless the defendant, Lane, can show either a legal title to the land or a superior equity growing out of his connection with the premises. Lane is a purchaser under the railroad company, holding a contract for the title from that company. The company, however, never acquired the title to this land, and therefore Lane has no better legal title than his vendor.
If the contract of sale had not been made, it is certainly true that the company, under the facts, could not successfully assert that it had either the record title or a right to the legal title of this land, and, therefore, if the company had interposed at the hearing in. the land office and had endeavored to defeat the right of Benner as a homestead occupant, on the ground of a superior title or a superior equity, such claim on its part would have wholly failed. So far as the legal title is concerned, Lane can show only a contract for sale from a vendor who has never become possessed of the record title, who has not established an equitable right or title to the land by the performance of the terms of the grant from the United States, and whose claim to the land has been adjudged to be invalid by the supreme court of the United States.
What are his equities as against those of the complainant? The purchase from the company upon which he rests his claim to the land was made in October, 1888. It was not made with the intent to create a home for the purchaser, but was purely a speculative transaction, and when the contract was entered into the defendant certainly well knew that the claim of the railroad company to the land had never been successfully asserted. At the time of the purchase, in October, 1888, Benner was in the open, possession of the land, and had been for more than four years, cultivating the same, and living thereon with his family. Lane does not claim that he entered into the contract of purchase in the belief that the land was unoccupied or that there were no conflicting claims thereto. Under the ordinary rule, when he entered into the contract he was chargeable with knowledge of the fact that Benner was in the actual occupancy of the land, and was therefore put upon inquiry as to the nature and extent of Benner’s rights, and the facts proven justify the holding that he had actual knowledge of Benner’s claim to the land. It must be kept in mind that no right or equity was created in favor of Lane until the contract of purchase was made in October, 1888. In point of time, therefore, his equity is inferior to that of Benner. His purchase was made, not to create a home, but for speculative purposes, *414and in its nature is inferior to that of Benner as a homesteader; for as is said in Moss v. Dowman, 176 U. S. 413, 20 Sup. Ct. 429, 44 L. Ed. 526:
“The obvious purpose of the pre-emption and homestead statutes of the United States is to'secure to the actual settler the land upon which he has settled, and to give him the prior right to perfect title by purchase or continued occupation. While, undoubtedly, under the provisions of the statutes and the regulations of the land department, there are opportunities for a speculator to obtain title to public lands, it must always be remembered that, in the eye of the public land laws of the United States, the speculator is never an object of favor.”
When Lane made his purchase, in 1888, he knew of the homestead claim made by Benner, and he knew that he could not procure title under his purchase except by defeating Benner’s claim. If, in making the purchase, he intended to rely upon any supposed rights in favor of purchasers created by the act of congress of March 3, 1887, his purpose was to attempt to defeat the rights of Benner, which came into existence in 1884, by relying on rights created by a statute which was not passed until three years after Benner had undertaken to create a home on the land. A purchase made under these circumstances and for such- a purpose cannot create an equity which is entitled to preference over the homestead equity existing in favor of Benner.
But it is contended that the act of 1887, as construed by the secretary of the interior, enables the defendant to assert a right to the land which would not exist in the absence of this statute. It was held by this court in Manley v. Tow, no Fed. 241, that these unearned lands in O’Brien county had not been conveyed to or for the use of the railway company, within the meaning of section 5 of the act of 1887; that the execution of a patent by the secretary of the interior to the state of Iowa of the lands could only be construed to be a conveyance to the state as a common trustee, and, as the lands were never earned by the company, the lands were never conveyed to the company, or “for its use and benefit,” within the meaning of these words as used in sections 4 and 5 of the act of 1887. In the contention now under consideration the thought is that Fane in making his purchase in 1888 had the right to assume that these lands had been patented to and were held by the state of Iowa for the use and benefit of the railroad company in such sense that, under the provisions of the act of 1887, he would get a good title against not only the United States, but also against all other claimants. When this purchase was made the line of railway had not been completed beyond Fe Mars, and the company had ceased the work of construction in 1872, 16 years before the date of the purchase, and in 1882 the legislature of Iowa had adopted an act declaring that all lands and rights to lands granted or intended to be granted to the Sioux City & St. Paul Railroad, which had not been earned by a compliance with the conditions of the grant, are resumed by the state of Iowa. In fact the railroad company never did acquire these lands, and never can do so in the future, and the title thereto at the date of the hearing before the land department was in the United States. There is equity in the view that congress, in passing the act of 1887 and 1896, intended to pro*415tect the rights of a bona fide purchaser who had bought lands the title to which had been in fact transferred by the government, and which would remain the property of the railway company, for whose benefit the lands had been patented, unless the government should reassert a right thereto by reason of the failure of the company to perform the terms of the grant. In the case now under consideration, when the act of 1887 was passed upon which the defendant bases his right, the company had long ceased to carry on the construction of the railway line, and had forfeited its right to all unearned lands, and the state of Iowa, by the act of 1882, had resumed the unearned grant, and had thus declared that these lands were no longer held by it in trust for the railway company. It is certainly true that if the act of congress of 1887 had not been passed neither the Sioux City & St. Paul Railroad Company, nor its grantee, could have compelled or secured the conveyance of the title to these lands. In case of Sioux City & St. P. R. Co. v. U. S., 159 U. S. 349, 16 Sup. Ct. 17, 40 L. Ed. 177, it was said, in response to the claim that in fact the title had vested in the railway company by virtue of the patent issued to the state of Iowa:
“In the case now before us the statute directed patents to be issued to the state for the benefit of the company; so that until the state disposed of the land the title was in it as trustee, and not in the railroad company.’’
Now, the trust imposed upon the state with respect to these lands was created by the act of congress, and not by any act of the railroad company. Under the act of 1864 the lands were granted to the 'state for the specific purpose of aiding in building a line of railway extending from Sioux City to the Minnesota state line, it being expressly .provided in the fourth section that the state would not dispose of the lands granted except for the purposes and in the manner named in the first section of the act. By accepting the trust thus created the 'state became bound primarily to the United States not to part with the title to the lands unless they were earned under the terms of the grant. The only obligation the state assumed to the railroad company was to convey to the company such portions of the grant as the company should earn under the provisions of the act.
It is settled by the decision of the supreme court in the case of Sioux City & St. P. R. Co. v. U. S., 159 U. S. 349, 16 Sup. Ct. 17, 40 L. Ed. 177, that long before the adoption of the act of 1887 the state had fully performed all the obligations it owed to the company, in that it had conveyed to the company all the lands which it had or could earn under the provisions of the grant of 1864, and therefore the state was holding the unearned lands, not in trust for the company, but as a trustee for the United States. When the act of 1887 was adopted all the rights and equities which the company could create in or to the lands embraced in the grant of 1864 had vested in the company, as it had long before ceased the further construction of the railway line. As to the earned lands the state held them in trust for the company, but as to the unearned lands the state held these in trust for the United States, and as the company, through its failure to complete the line of railway, had failed to create any *416right, title, or equity in or to these unearned lands, neither it nor its grantee can rightfully claim that the company had ever become entitled to the use or benefit of the land, or that the state held the same for the use and benefit of the company. By the terms of the act of 1864 the grant was to the state of Iowa to secure the building of the named line of railway, and not to any named railway company, and when the state accepted the grant it became bound as a trustee not to permit the lands to be disposed of for any other purpose. By ■consent of the state, the Sioux City & St. Paul Company undertook the construction of the proposed line of railway, and the state became bound to it to hold, for its use and benefit, such portions of the grant as the company should become entitled to, and no more; and, as it is settled that the company never earned the lands in dispute, it cannot be said, in any just sense, that the state held these lands for the use and benefit of the company at the date of the adoption of the act ■of 1887, or that the United States had conveyed the title for the use and benefit of the company. For these reasons I adhere to the view expressed in Manley v. Tow, supra, that:
“To give a preference to the purchaser under the provisions of section 5, it must appear that at the date of the sale to him by the railway company the title to the land purchased had been conveyed by the United States to the company, or to some one for its use and benefit. A conveyance by the United States of land to a third party as a trustee, to be held by the trustee, in order to ascertain whether the railway company will, earn the lands, it being the duty of the trustee to reconvey the lands to the United States if the conditions of the grant are not performed, is not a conveyance to the company or for its use, within the meaning of section 5 of the readjustment act.”
If this is the correct interpretation of section 5, it follows that under the provisions of that section the homestead claim of Benner is to. be given the preference over the claim of the purchaser, thus entitling the complainant to the relief sought by the bill herein filed.
Should this construction of the provisions of sections 4 and 5 of the act of 1887 not be .sustainable, yet the rights conferred by these sections, and also by the act of 1896, are only available to bona fide purchasers, and therefore to secure a preference in the disposition of the lands the purchaser must show that, as between himself and the homestead claimant, he is a bona fide purchaser. When the purchase relied on by defendant was made he knew that the complainant was in the actual possession and occupancy of the land, and he therefore entered into the contract of purchase charged with knowledge of the superior equity of the complainant and subject to his rights, and it ■cannot be held that as against complainant the defendant is a bona fide purchaser. The remedial purpose of the acts of 1887 and 1896 in the recognition of the equities of purchasers is to be given fair and full ■effect against the government, but the waiver of the rights of the government was not intended to be a denial of the rights and equities of third parties, nor to create a preference in favor of purchasers over the rights of third parties which had come into existence and had become Attached to the land years before the date of the purchase, and in fact-years before the adoption of the act which is the sole foundation of the right relied upon by defendant. Under the facts of this case it cannot *417be held that, as against the rights of the complainant, the defendant is a purchaser in good faith.
The conclusion reached is that, under the facts of this case, it was an error of law to hold that the defendant was entitled to a patent to the land as against the right of the complainant based upon his homestead claim and occupancy, and it is therefore held that complainant is entitled to a decree establishing his title to the land as prayed for in the bill herein filed.