delivered the opinion of the Court:
The Indiana arid Illinois Central Railroad Company, of which it is stipulated the appellant company was the legal successor, in 1872 entered upon the tract of land in dispute and built thereon its railway, under an agreement entered into by the owners of the land in 1854. By that agreement, under the hands and seals of the owners, they agreed, for the consideration therein named, to convey to the said .Indiana and Illinois Central Railroad Company, within one year, by quitclaim deed containing a covenant of warranty as against all persons claiming under them, a strip of land one hundred feet wide, out of the quarter section upon which the strip in controversy is situated, and other tracts particularly described and owned by them, as said railroad should be located through <or over said lands; and it was expressly agreed, that “on the definite location of said road” said railway company should have “full power to enter upon said lands and premises of the width aforesaid, and to occupy, use and control the same, with all the rights, privileges, profits and appurtenances of every kind, as in fee simple, so long as the route or track of .said railroad shall continue to be over and upon the same.” And it was further provided, that if the use of the land by the company should be abandoned or the tracks permanently changed, said lands should revert; and that the said railroad company should erect and maintain fences, cattle-guards, crossings, etc,, necessary to the use of the land, at its own charge. No deed was ever made, but in 1872, the ownership of the lands remaining the same, said railway company entered upon and took possession of the tract in dispute, built thereon its roadway and tracks, and has ever since continued to occupy and use the same as its right of way.
If this suit had been brought by Hayward, the owner making said agreement, and who continued to be the owner up to the year 1887, and who permitted the railroad company, without objection, to enter upon said land and build its railroad thereon, it is clear he could not have maintained this action. By the agreement, executed under his hand and seal, the right was given, upon the “definite location” of the railroad, to enter upon, use and occupy the land. The railroad company was lawfully in possession under the agreement, it having performed the conditions on its part,—that is, the definite location of its line of road on the land.
While, as a general rule, the legal title must prevail in actions at law, ejectment can not be maintained against one in the lawful and rightful possession of land. “That action,” it is said in Stowe v. Russell et al. 36 Ill. 36, “proceeds for the possession of the premises, claiming they have been unlawfully entered upon and unjustly withheld,” and it was held that facts which disprove the unlawful entry or unjust withholding constitute a legal defense to the action. In Turpin v. Baltimore and Ohio and Chicago Railroad Co. 105 Ill. 11, a case not distinguishable in principle from the one at bar, it was said; “Where the defendant’s possession is rightful and the plaintiff is not wrongfully kept out of possession, it is very well settled by the decisions of this court that the action of ejectment can not be sustained.” The same principle has been announced, with more or less distinctness, in Sloan v. Petrie, 16 Ill. 262, Staley v. Murphy, 47 id. 241, Kilgour v. Gockley, 83 id. 112, Gridley v. Hopkins, 84 id. 532, Railway Co. v. Karnes, 101 id. 403, and Chicago and Eastern Illinois Railway Co. v. Hay, 119 id. 493. In view of these decisions an examination of the general rules will not be necessary.
It is stipulated that appellee (plaintiff below) purchased the land in 1887,—practically fifteen years after the road had been built and in operation. The possession by the railway company was notice to him that it was there under a claim of right, and the slightest inquiry, either of his grantor, Hayward, or of the railway company, would have advised him of the extent and nature of that right, and that the possession was under said agreement for a deed, with the right to enter upon, use and occupy the land as a railroad right of way, as it was being used, and he, therefore, stands in no better position to question the rightfulness of the entry and occupancy by the railway company than did his grantor.
It is, however, said, that the railroad company was guilty of laches in not building its road-across the land for eighteen years after the agreement was entered into. Of this, it only need be said that appellee, being chargeable, at the time of his purchase, with notice of the railway company’s rights, can not be heard to complain of laches which his grantor had waived by permitting the railway company to enter under the contract, construct its road, and operate it for fifteen years before appellee acquired any interest in the land. The agreement having been acted upon and the railroad constructed, its provisions were binding upon the original owner and his grantee with notice. Russell v. Hubbard, 59 Ill. 335 ; Morris v. Indianapolis, Bloomington and Western Railroad Co. 76 id. 522; Turpin v. Railroad Co. supra.
The cause having been tried before the court without a jury, a motion for a new trial was unnecessary to preserve the questions arising upon the record.
We are of the opinion that the facts here shown constituted a legal defense to the plaintiff’s action, and the judgment of the circuit court will accordingly be reversed and the cause remanded.
Judgment reversed1.