The opinion of the court was delivered by
Smith, J.:On the authority of Cowley County v. Hooker, 70 Kan. 372, 78 Pac. 847, the plaintiff in error would have been entitled to recover all the damages he could prove to all of his land taken or affected by the laying out of. the public road had he not filed the petition in the district court. The county commissioners, having proceeded to lay out and open the road along the entire length thereof as if no road previously existed over any portion of the line, could not be heard to say, on a trial to determine the amount of damages, *344that the road or some portion thereof existed prior to their proceeding. The plaintiff in error, however, having filed the petition and having therein asserted facts which the commissioners would not have been heard to allege, must stand or fall by his petition.
In determining whether the petition stated a cause of action we have to determine, ‘first, whether the grant of the three sections of land to the Union Pacific Railway Company under the act of congress of 1862 be-, came effective and conveyed rights in the land prior to the time of the grant of a right of way for public roads along sections of lands of the United States not reserved for public use, under the act of 1866 (Rev. Stat. U. S. 1901, § 2477)., or whether the converse is true; second, whether the grant of the right of way became effective along the west side of section 4 prior to the . acquiring of any rights in the land by the homestead settler who conveyed the same to the plaintiff, or whether the converse is true.
The act of 1862 (12 U. S. Stat. at L. p. 489) for wise and beneficent purposes granted to the Union Pacific Railway Company the odd sections of land along either side of the proposed railroad "bed within a certain distance, subject only to the performance by thé railway company of certain conditions specified in the act. The petition alleges that all of these conditions were long ago performed by the railway company; that a map of the general route of the railroad along these lands was filed in the land-office July 11, 1866, and on the same day the lands in question were withdrawn from settlement; and that a map of definite location of the route of the railroad was filed with, and accepted by, the secretary of the interior on September 21, 1867. These allegations are taken as true upon the demurrer, and under the law the rights of the railway company attached upon the filing of the map of definite location and related back and became effective as of the date of the grant in 1862. On the other hand, the act of con*345gress in 1866 which granted a right of way for highways over the public lands of the United States not reserved for public uses (Rev. Stat. U. S. 1901, § 2477), and which was accepted by the act of the legislature of Kansas in 1873 (Laws 1873, ch. 122), became effective upon the passage of the act by the legislature and related back to the date of the grant in 1866. It will be observed, therefore, that at the time of the grant for public-road purposes in 1866 the lands in question belonged to the Union Pacific Railway Company, or at least the railway company had an interest therein, and they were not public lands of the United States within the meaning of the act of 1866. Indeed, it had passed beyond the power of congress to derogate from _ the rights of the railway company to the lands in question, which had been conveyed to the company under the grant of 1862. (Kneeland v. Korter, 40 Wash. 359, 82 Pac. 608; Mo., etc., Ry. Co. v. Kan. Pac. Ry. Co., 97 U. S. 491, 24 L. Ed. 1095; Buttz v. Northern Pacific Railroad, 119 U. S. 55, 7 Sup. Ct. 100, 30 L. Ed. 330; Railroad Co. v. Baldwin, 103 U. S. 426, 26 L. Ed. 578.)
As to the strip taken for the road off of section 4, it will be observed from the foregoing that the grant of a right of way for public roads became effective and related back to the passage of the act in 1866, and there is no allegation in the petition that the government did not have the full right to dispose of the land at that time. So far as the petition shows, this section was United States government land and was not reserved' for public purposes. Nor is there any allegation that the plaintiff or his homestead grantor had acquired any right to the land at that time. On the other hand it affirmatively appears that all their claim of rights thereto attached many years later. (Tholl v. Koles, 65 Kan. 802, 70 Pac. 881.)
There is no allegation in the petition of facts indicating that the roadway along section 4 was not open from the time of the passage of the act of the legisla*346ture in 1873 (Laws 1873, ch. 122) until the commencement of this proceeding. Hence it cannot be said that the road created by that act along section 4 had been vacated by non-user or that it was “unopened” within the meaning of section 6058 of the General Statutes of 1901. (Webb v. Comm’rs of Butler Co., 52 Kan. 375, 34 Pac. 973; City of Topeka v. Russam, 30 Kan. 550, 2 Pac. 669; Peck and another v. Clark et al., 19 Ohio, 367.)
It follows that the petition states a cause of action for damages to the railroad lands, and fails to state a cause of action as to the homestead lands.
The ruling and judgment of the district court is reversed, and the case is remanded with instructions to proceed in accordance with the views herein expressed.
All the Justices concurring.