The opinion of the court was delivered by
Burch, J.:Chapter 198 of the Laws of 1895 (amended by Laws 1905, ch. 352, § 1, Gen. Stat. 1909, §§ 7160-7162) provides that whenever it may be necessary for any or all of the officers or men of the Kansas national guard or Kansas reserve militia to travel upon any railroad of the state, under orders from competent, authority to perform military duty, the transportation shall be furnished at the rate of one cent per mile for the distance traveled by each person. Orders for transportation issued by the adjutant general must be honored in lieu of fare, and then be presented to the military board, to be audited and paid at the fixed rate. Willful refusal on the part of the agent of a railroad company to observe the terms of the act is punishable by fine. In June, 1909, the petitioner, as agent of the *265Union Pacific Railroad Company at Topeka, refused a requisition duly made for the transportation of Major Arthur Mills, of the Kansas national guard, at the statutory rate. The petitioner was arrested, convicted and fined, and ordered committed to the jail of Shawnee county until the fine and costs should be' paid. After the time for an appeal had expired he instituted this proceeding in habeas corpus to secure his release from custody under a commitment issued upon the judgment. The principal question raised upon the sheriff’s return to the writ of habeas corpus is whether the statute denies the railroad company the equal protection of the laws guaranteed by the fourteenth amendment to the constitution of the United States.
In 1883 (Laws 1883, ch. 124, § 1; see Gen. Stat. 1909, § 7198) the legislature fixed three cents per mile as the maximum rate for carrying adult passengers, and this rate has not since been changed by law. In 1907 the board of railroad commissioners issued an order fixing the maximum rate at two cents 'per mile. The order is still in force, and at all times material to the controversy was being observed by the railroad companies. These measures were adopted pursuant to the power of the state to regulate rates and protect the traveling public from unjust exactions, and they reflect the judgment of the constituted authorities as to what is reasonable for the railroads to charge and for the people to pay. Presumably two cents per mile is a reasonable rate for all adult passengers, or it would not have been promulgated and would not be maintained.
Ordinarily, when the ratemaking power of the state has been exercised and a reasonable maximum fare for people generally has been established, it is not then competent for the legislature to -compel the railroad companies to make exceptions in favor of certain individuals. The legislature of the state of Michigan amended the general railroad law of that state so that it required the sale of one-thousand-mile tickets at a *266reduced rate, required such tickets to be issued on request to the purchaser, his wife and children, and made them valid for two years from the date of purchase. The supreme court of the United States held this law to be in violation of that portion of the constitution of the United States which forbids the taking of property without due process of law and which secures the equal protection of the laws. (Lake Shore &c. Railway Co. v. Smith, 173 U. S. 684.) The views of the court are indicated in the following extracts from the opinion:
“The power of the legislature to enact general laws-regarding a company and its affairs does not include the power to compel it to make an exception in favor of some particular class in the community and to carry the members of that class at a less sum than it has the right to charge for those who are not fortunate enough to be members thereof. This is not reasonable regulation. ... If the general power exist,' then the legislature can direct the company to charge smaller rates for clergymen or doctors, for lawyers or farmers or school-teachers, for excursions, for church conventions, political conventions, or for all or any of the various bodies that might desire to ride at any particular time or to any particular place.
“If the legislature can interfere by directing the sale of tickets at less than the generally established rate, it can compel the company to carry certain persons or classes free. If the maximum rates are too high in the judgment of the legislature it may lower them, provided they do not make -them unreasonably low, as that term is understood in the law; but it can not enact a law making maximum rates-, and then proceed to make exceptions to it in favor of such persons or classes as in the legislative judgment or caprice may seem proper. . . . The legislature having fixed a maximum rate at what must be presumed, prima facie, to be also a reasonable rate, we think the company then has the right to insist that all .persons shall be comne-lled to pay alike, that no discrimination against it in favor of certain classes of married men or families, excursionists or others, shall be made by the legislature. If otherwise, then the company is compelled at the caprice or whim *267of the legislature to make such exceptions as it may-think proper and to carry the excepted persons at less than the usual and legal rates, and thus to part in their favor with its property without that compensation to which it is entitled from all others, and therefore to part with its property without due process of law. The affairs of the company are in*this way taken out of its own management, not by any general law applicable to all, but by a discrimination made by law to which the company is made subject. Whether an act -of this nature shall be passed or not is not a matter of policy to be decided by the legislature. It is a matter of right of the company to carry on and manage its concerns subject to the general law applicable to all, which the legislature may enact in the legal exercise of its power to legislate in regard to persons and things within its jurisdiction. ... In this case there is not an exercise of the power to fix maximum rates. There is not the exercise of the acknowledged power to legislate so as to prevent extortion or unreasonable or illegal exactions. The fixing of the maximum rate does that. It is a pure, bald and unmixed power of discrimination in favor of a few of the persons having occasion to travel on the road and permitting them to do so at a less expense than others, provided they buy a certain number of tickets at one time. It is not legislation for the safety, health or proper convenience of the public, but an arbitrary enactment in favor of the persons •spoken of, who in the legislative judgment should be carried at a less expense than the other members of the community. There is no reasonable ground upon which the legislation can be rested unless the simple ■decision of the legislature should be held to constitute such reason.” (pp. 692-698.)
This court is not inclined to the view that the power of the legislature is completely exhausted by a maximum-rate regulation, and does not so interpret the decision quoted. But members of the national guard can not be segregated from the body of the state’s citizens and made a preferred class, unless they sustain some relation to transportation by rail which, in the nature of things, indicates they should have the benefit of an ■exceptional rate. Classification, to be valid, must be *268based upon differences in character, condition or situation which lead to that difference in regulation which the statute undertakes to make. Thus, in the case involving a reduced rate for school children on street cars (Commonwealth v. Interstate, &c. Street R’y, 187 Mass. 436), the considerations which moved the court to sustain the rate were, among others, that pupils go to and from the public schools at hours when other persons make little use of the cars; that they are of such a size and age that they occupy much smaller spaces than other passengers; and that the difference in rate was of so much importance to parents that twice as many pupils would ride at half rate as at full rate, so that the revenues of the carrier would not be materially reduced. This court neither approves nor disapproves the conclusion reached in that case, but the method employed for testing the classification upon which the rate-was based is sound. In accordance with the principle recognized, the legislature might no doubt require that precedence be given to the transportation of troops over other traffic, that special facilities for the movement of troops be supplied, that special schedules be adopted and that other exceptional services be rendered whenever the public interest demands them. But the law in question has no such basis for the discrimination which it makes. Major Mills stood upon precisely the same footing, so far as the expected service to him was concerned, as any other individual. The times when members of the national guard will travel are as uncertain as for other people. The number who will travel at any particular time is wholly indefinite. They come to the railroad stations singly, in groups or in larger bodies, just as other citizens come singly, in groups or in crowds sufficient to load the cars of one or more trains.. They occupy the same space and have the same privileges as other persons. Their movements are controlled by duty and not by special inducements, and the matter of rate can have no effect upon the volume of traffic. *269They are taken up, carried and set down without any mark or circumstance whatever to distinguish them from the general public, or to distinguish the subject of their transportation from that of the general public, except that they carry orders for transportation without payment of fare and at reduced rates. Without any ground, therefore, for the classification, • and without any regard to the reasonableness or unreasonableness of the regulation, the state simply demands that its troops be transported by rail at a purely arbitrary rate, which, so far as the principle involved is concerned, might be one cent per hundred miles or nothing at all. No other corporation or individual in the state is obliged to conduct business upon any such partial and unequal conditions or to make any such sacrifice for the support of the national guard or any other public institution or purpose. Therefore the act denies the railroads the equal protection of the laws.
So far the act in question has been regarded as one relating in some way to the subj ect of railroad regulation. That is not its true character. It is a revenue .measure, which seeks to protect the treasury and keep down the rate of taxation upon the general property of the state by levying a special assessment upon railroad companies for the maintenance of the military department of the government. Viewed from this standpoint, the statute selects railroad companies from among other common carriers, corporations and property owners- of the state, places them in a class by themselves, and imposes upon them a specific burden, supposedly for the public welfare. In many instances this may be done, but it can not be done where the exaction is made to defray an expense having no more relation to the business of railroading than it has to any other business enterprise conducted within the state. This limitation was clearly stated by Mr. Justice Field in the case of Charlotte &c. Railroad v. Gibbs, 142 U. S. *270386. The state of South Carolina created a board of railroad commissioners charged with a variety of duties respecting the conduct of railroad affairs, and assessed the expenses and salaries of the members of the board to the railroad companies. The court held that the existence and presence of the railroad companies and their property in the state and the exercise of the privileges and franchises which they enjoyed created the necessity for the supervisory board; that the services of the board were rendered for the benefit of the railroads as well as for the public, and consequently that the cost of the service might lawfully be imposed upon the railroads. But the opinion reads:
“If the tax were levied to pay for services in no way connected with the railroads, as for instance, to pay the salary of the executive or judicial officers of the state, whilst railroad corporations were at the same time subjected to taxation upon their property equally with other corporations for such expenses, and other corporation's were not taxed for the salaries mentioned, there would be just ground of complaint of unlawful discrimination against the railroad corporations, and of their not receiving the equal protection of law.” (p. 391.)
The principle involved has been applied. in many cases. A railroad company may be required to build fences and cattle guards (Missouri Pacific Railway Co. v. Humes, 115 U. S. 512), to erect gates, plank crossings and maintain flagmen (Chicago, Burlington &c. R’d v. Chicago, 166 U. S. 226), and to bear the whole cost of making changes of grade at crossings (N. Y. & N. E. Railroad Co. v. Bristol, 151 U. S. 556), because the expenditure is necessary for the protection of persons and property otherwise endangered by the operation of the road, and because the company itself is specially benefited by the greater security which it obtains for the prosecution of its business. Examinations of railway employees may be required and the fees therefor be charged to the railway companies. *271(Nashville &c. Railway v. Alabama, 128 U. S. 96.) Fees for quarantine inspection are regarded as compensation for services rendered to the vessel. (Morgan v. Louisiana, 118 U. S. 455.) Fees charged for the inspection of mines may be charged to the owner. (St. Louis Cons. Coal Co. v. Illinois, 185 U. S. 203.) The salaries and expenses of -a board of commissioners of' electrical subways may be charged to the companies whose business renders the creation of the board a necessity, and for whom, as well as the public, the sex-vices of the board are performed. (New York v. Squire, 145 U. S. 175.) In all such cases, and many more might be cited, there is no denial of the equal protection of the laws. It can scarcely be claimed, however, that the national guard is maintained because of anything occasioned by the existence or operation of railroads in the state, or that the railroads derive any benefit from the existence of the national guard which is not shared by every other person in the state. The presence in the state of this body of men is beneficial'to the railroads just as the government of the state, the various municipal governments, the courts and the whole body of public functionaries are beneficial to them, and in no other way; and the equal protection of the laws requires not only that all persons brought within the influence of a statute shall be treated alike but-that a classifying statute must bring within the equal influence of its provisions all persons who are under the same conditions.
An effort is made to justify the statute as an exercise of the military power of the state to preserve peace, to suppress riot's and insurrections and to repel invasion. These are ends which every sovereignty must have the power to attain, and every citizen holds his property upon the implied condition that it must be surrendered when needed for the preservation of the government. Fields and farms may be traversed and occupied, sub*272sistence, stores and other movables may be appropriated and transportation lines may be seized and operated, under the stress of due occasion, just as city blocks may be demolished to arrest the progress of a fire. Doubtless in cases where neither the power of taxation nor the credit of the government would avail a forced loan could be effected by the seizure of money itself. The power exercised in such cases is lawful, although not derived from constitutions or statutes. It rests upon the principle that every sovereignty may, in time of peril, adopt such extreme measures as may be necessary for its existence and perpetuity. But it is limited to emergencies which can not wait upon due process of law. The law governing military impressment of private property was well stated by Mr. Chief Justice Taney in the case of Mitchell v. Harmony, 54 U. S. 115, as follows:
“There are, without doubt, occasions in which private property may lawfully be taken possession of or destroyed to prevent it from falling into the hands of the public enemy; and also where a military officer, charged with a particular duty, may impress private property into the public service or take it for public use. Unquestionably, in such cases, the government is bound to make full compensation to the owner; but the officer is not a trespasser.
“But we are clearly of opinion that in all of these cases the danger must be immediate and impending, or the necessity urgent for the public service, such as will not admit of delay, and where the action of the civil authority would be too late in providing the means which the occasion calls for. It is impossible to define the particular circumstances of danger or necessity in which this power may be lawfully exercised. Every case must depend on its own circumstances. It is the emergency that gives the right, and the emergency must be shown to exist before the taking can be justified.
“In deciding upon this necessity, however, the state of the facts, as they appeared to the officer at the time he acted, must govern the decision; for he must necessarily act upon the information of others as well as *273his own observation. And if, with such information as he had a right to rely upon, there is reasonable ground for -believing that the peril is immediate and menacing, or the necessity urgent, he is justified in acting upon it; and the discovery afterward that it was false or erroneous, will not make him a trespasser. But it is not sufficient to show that he exercised an honest judgment, and took the property to promote the public service; he must show by proof the nature and- character of the emergency, such as he had reasonable grounds to believe it to be, and it is then for a jury to say whether it was so pressing.as not to admit of delay; and the occasion such, according to the information upon which he acted, that private rights must for the time give way to the common and public good. . . . The case mentioned by Lord Mansfield, in delivering his opinion in Mostyn v. Fabrigas, 1 Cowp. 180, illustrates the principle of which we are speaking. Captain Gambier, of the British navy, by the order of Admiral Boscawen, pulled down the houses .of some sutlers on the coast of Nova Scotia, who were supplying the sailors with spirituous liquors, the health of the sailors being injured by frequenting them. The motive was evidently a laudable one, and the act done for the public service. Yet it was an invasion of the rights of. private property, and without the authority of law, and the officer who executed the order was held liable to an action, and the sutlers recovered damages against him to the value of the property destroyed.
“The case shows how carefully the rights of private property are guarded by the laws of England; and they are certainly not less valued nor less securely guarded under the constitution and laws of the United States.” (pp. 134-136.)
When, however, the government is in no extremity in fact which requires the suspension in whole or -in part of the civil laws, contributions- to its support can not be levied upon private persons or corporations except pursuant to laws which prescribe the occasions, modes, conditions and agencies for the appropriation and which bear equally upon all those who are similarly situated.
The petitioner is discharged.