delivered the opinion of the court.
Charles L. McGuire, the defendant in error, while acting as a brakeman in the service of the Chicago, Burlington and Quincy Railroad Company in Iowa, in the year 1900, received injuries through negligence imputable to the Company and recovered judgment in the District Court of that State for the sum of $2,000. By stipulation, the Chicago, Burlington and Quincy Railway Company *560was joined in the judgment. It was affirmed by the Supreme Court of the State of Iowa and the companies bring this writ of error.
The question presented is with respect to the validity of § 2071 of the Code of. Iowa as amended in the year 1898, which was held to preclude the Railroad Company from making the defense that recovery was barred by the acceptance of benefits under a contract of membership in'its Relief Department.
The section in its original form was as follows:
“Every corporation operating a railway shall be liable for all damages sustained by any person, including the employés of such corporation, in consequence of the neglect of the agents, or by any mismanagement of the engineers or other employés thereof, and in consequence of the wilful wrongs, whether of commission or omission of such agents, engineers, or other employés; when such wrongs are in any manner connected with the use and operation of any railway on or about which they shall be employed and no contract which restricts such liability shall be legal or binding.”
The amendment of 1898 added the following provision:
“Nor shall any contract of insurance relief, benefit or indemnity in case of injury or death, entered into prior to the injury, between the person so injured and'such corporation or any other person or association acting for such corporation, nor shall the acceptance of any such relief, insurance, benefit or indemnity by the person injured, his widow, heirs or legal representatives after the injury, from súch corporation, person or association, constitute any bar or defense to. any cause of action brought under the provisions of this section: but nothing contained herein shall be construed to prevent or invalidate any settlement for damages between the parties subsequent to the injuries received.”
The question arose upon demurrer to the. defense in the *561answer of the Railroad Company, which asserted the bar denied by the statute. This defense, in substance, alleged that in November, 1900, and prior to-his injury, the defendant in error had voluntarily become- a member of the Relief Department of the Railroad Company and thereupon had agreed that the acceptance of benefits payable to him in accordance with the regulations of the department should discharge the Company from all liability for damages; that after he had sustained the injuries alleged in his petition, he had received benefits from the Relief Fund of the- department amounting to 1822.; and that the payment and acceptance of these benefits constituted, under the agreement, full satisfaction of the claim in suit.
The fácts with regard to the organization, purpose and management of the Relief Department, and the regulations' governing it, were fully averred. The department was organized in 1889, as a part of the, service of the Railroad Company, with the object of creating a fund out of which definite amounts of money should be paid to contributing employés in the event of disability from sickness or accident, or in case of death for their proper burial and the relief of their families. The various companies forming the Burlington system organized similar departments, and by agreement these were associated in joint administration.
The regulations of the Relief Department provided that membership in the department should be voluntary and defined the amount of contributions to be paid monthly, the members being classified for this purpose according to their monthly wages. The amount of benefits according to these classes was also specified. The Relief Fund consisted of the contributions of members, income from investments, interest paid by the Railroad Company on. monthly balances and appropriations made by the Com-’ pany when necessary to cover deficiencies. From the time of organization to December 31,1900, there was paid *562in benefits out of the fund so constituted the sum of $2,671,510.54, of which $1,294,790.50 was paid by reason of sickness and$l,376,720.04 for injuries and death.
The Railroad Company had general charge of the Relief Department and guaranteed the fulfilment of its obligations. It was responsible for the safe-keeping of the moneys of the Relief Fund, paid into the fund interest at the rate of four per centum per annum on monthly balances, supplied without expense to the fund the necessary facilities for the business of the department, and defrayed from the .moneys of the Company the operating expenses. It was alleged that for these expenses the Company had paid to December, 1900, $621,572.44. This sum did not include office rent for the department or of medical examiners or various sundry expenses; nor did it embrace the service of officers and of clerks who were not wholly concerned with the work of the department, and this servicé and incidental expenses were alleged to be worth approximately $50,000 a year. In addition, during the period mentioned the Railroad Company paid to make up deficits in the fund the sum of $42,532.94, for which it had no right to reimbursement.
Among the regulations by which the members of the Relief Department agreed to be bound was the following:
“64. In case of injury to a member he may elect to accept the benefits in pursuance of these regulations, or to prosecute such claims as he may have at law against the Company or any Company associated, therewith in the administration of their Relief Departments.
“The acceptance by the member of benefits for injury shall operate as a release and satisfaction of all claims against the Company and all other companies associated therewith as aforesaid, for damages arising from or growing out of such injury; and further, in the event of the death of a'member no part of the death benefit or unpaid disability benefit shall be due or payable unless and. until *563good and sufficient releases shall be delivered to the superintendent, of all claims against the 'Belief Department, as well as against the Company and all other companies associated therewith as aforesaid, arising from or growing out of the death of the member, said releases having been duly executed by all who might legally assert such claims; and furthér, if any suit shall be brought against the Company or any other company associated therewith as aforesaid, for damages arising from or growing out of injury or death occurring to a member, the benefits otherwise payable and all obligations of the Relief Department and of the Company created by the membership of such member in the Relief Fund shall thereupon be forfeited without any declaration or other act by the Relief Department or the Company; but the'superintendent may, in his discretion waive such forfeiture upon condition that all pending suits shall first be dismissed.
“The payment by the Company, or any Company associated therewith as aforesaid, of any amount in compromise of a claim, for damages arising from or growing out of an injury to, or the death of, a member, shall preclude any and all claims for benefits from the Relief Fund arising from, or growing out of such injury or death.”
In support of the defense based upon this regulation, the Railroad Company further asserted that, the amended statute above quoted did not deprive it of the right to plead the contract with the defendant in error, and its satisfaction, as a discharge, for the reason that the statute was repugnant to the Fourteenth Amendment of the Constitution of the United States, (1) as an unwarranted interference with liberty to make contracts, and (2) as a denial of the equal protection of the laws.
The District Court overruled the demurrer, but its judgment was reversed by. the Supreme Court of the State, which held the statute to be' valid and in consequence that the . demurrer should have been sustained. *564McGuire v. C., B. & Q. R. R. Co., 131 Iowa, 340. This ruling was adhered to when the question was again raised on the appeal to that court from the final judgment. 138 Iowa, 664. And to review this decision as to the constitutionality of the statute, the case has been brought here.
We pass without comment the criticisms which are made of certain details of the relief plan, for neither the suggested excellence nor the alleged defects of a particular scheme may be permitted to determine the validity of the statute, which is general in its application. The question with which we are concerned is not whether the regulations set forth in the answer are. just or unjust, but whether the amended statute transcends the limits of power as defined by the Federal Constitution..
The first ground of attack is that the statute violates tl}e Fourteenth Amendment by reason of the restraint it lays upon liberty of contract. This section of the Code of Iowa (§ 2071), as originally enacted, imposed liability upon railroad corporations for injuries to employés, although . caused by the negligence or mismanagement ofellow-servants. And it was held by this court that it was clearly within the competency of the legislature tó prescribe this measure of responsibility. Minneapolis & St. Louis Railway Co. v. Herrick, 127 U. S. 210, following Missouri Railway Co. v. Mackey, 127 U. S. 205. The statute in its original form also provided that “no contract which restricts such liability shall be legal or binding.”
Subsequent to,this enactment the Railroad Company established its Relief Department, and the question was raised in the state court as to the' legality of the provision then incorporated in the contract of membership, by which, in case of suit for damages, the payment of. benefits was to be suspended- until the suit should be discon*565timied, and the acceptance of benefits was to operate as a full discharge. The two principal contentions against it were, first, that it was against public policy, and second, that it was in violation of the statute. Both were overruled, and with reference to the statute it was held that the contract of membership did not fall within the prohibition for the reason that it did not restrict liability but put the employé to his election. Donald v. C., B. & Q. Ry. Co., 93 Iowa, 284; Maine v. C., B. & Q. R. R. Co., 109 Iowa, 260. The legislature- then amended the section by providing expressly that a contract of this sort and the acceptance of benefits should not defeat the enforcement of the liability which the statute defined.
Manifestly the decision that the existing statute-was not broad enough to embrace the inhibition did not prevent the legislature from enlarging its scope so that it should be included. ' Nor was the holding of the court final upon the point of public policy, so far as the power of the legislature is concerned. The legislature, provided it acts within' its constitutional authority, is the arbiter of the public policy of the State. While the court, unaided by legislative declaration and applying the principles of the common law, may uphold or condemn contracts in the light of what is conceived to be public policy, its determination as a rule for future action must yield to the legislative will when expressed in accordance with the organic law. If the legislature had the power to incorporate a similar provision in the statute when it was passed originally, it had .the same power with regard to future transactions to enact the amendment.
It may also be observed that the statute, as amended, does not affect contracts of settlement or compromise made after the injury, -and the question of the extent of the legislative power with respect to such contracts is not presented. The amendment provides, “but nothing contained herein shall be construed to prevent or invalidate *566any settlement for damages between the parties subsequent to the injuries received.” As was said by the state court in construing the act (131 Iowa, p. 377): " The legislature does not in this act forbid or place any obstacle in the way of such insurance, nor does it forbid or prevent any settlement of the matter of damages with an injured employé fairly made after the injury is received. On the contrary, the right to make such settlement is expressly provided for in the amendment to Code § 2071. The one .thing which that amendment was intended to prevent was the use of this insurance or relief for which the em-. ployé has himself paid in whole or in part, as a bar to the rigfyt which the statute has given, him to recover damages from the corporation.” It is, mrged, however, that the amendatory act prohibits the making of a contract for settlement "by acts done after the liability had-become fixed.” The acceptance of benefits is, of course, an act done after the injury, but the legal consequences sought to be attached to that act áre derived from .the provision •in the contract of membership. The stipulation which the statute nullifies'is one máde in advance of the injury thát the subsequent acceptance of benefits shall constitute full satisfaction of the claim for damages. It is in this aspect that the question arises as to the restriction of liberty of contract.
It has been held that the right to make contracts is embraced in the conception of liberty as guaranteed by the Constitution. Allgeyer v. Louisiana, 165 U. S. 578; Lochner v. New York, 198 U. S. 45; Adair v. United States, 208 U. S. 161. In Allgeyer v. Louisiana, supra, the court, in referring to the Fourteenth Amendment, said (p. 589): "The liberty mentioned in that amendment means not only the right of .the citizen to be free from the mere physical restraint of his Rerson, as by incarceration, but the term is deemed to embrace the right of the citizen to be free in the enjoyment of all his faculties; to be free to use *567them in all lawful ways; to live and work where he will; to earn his livelihood by any lawful calling; to pursue any livelihood or avocation, and for that purpose to enter into all contracts which may be proper, necessary and essential to his carrying out to a successful conclusion the purposes above mentioned.” But it was recognized in the cases cited, as in many others, that freedom of contract is a qualified and not an absolute right. There is no absolute freedom to do as one wills or to contract as one chooses. The guaranty of liberty does not withdraw from legislative supervision that wide department of activity which consists of the making of contracts, or deny to government the power to provide restrictive safeguards. Liberty implies the absence of arbitrary restraint, not immunity from reasonable regulations and prohibitions imposed in the interests of the community. Crowley v. Christensen, 137 U. S. p. 89; Jacobson v. Massachusetts, 197 U. S. p. 11. “It is within the undoubted power of government to restrain some individuals from all contracts, as well as all individuals from some contracts. It may deny to all the right to contract for the purchase or sale of lottery tickets; to the' minor the right to assume any obligations, except for the necessaries of existence; to the common carrier the power to make any contract releasing himself from negligence, and, indeed, may restrain all engaged in any employment from any contract in the course of that employment which is against public policy. The possession of this power by government in no manner conflicts with the proposition that, generally speaking, every citizen has a right freely ,to contract for the price of his labor, services, or property.” Frisbie v. United States, 157 U. S. pp. 165, 166.
The right to make contracts is subject to the exercise of the powers granted to Congress for the- suitable conduct of matters of national concern, as for example the regulation of commerce with foreign nations and among the *568several States. Addyston Pipe & Steel Co. v. United States, 175 U. S. pp. 228-231; Patterson v. The Eudora, 190 U. S. 174-176; Atlantic Coast Line Co. v. Riverside Mills, 219 U. S. 186; Louisville & Nashville R. R. Co. v. Mottley, decided this day, ante, p. 467.
It is subject also, in the field of state action, to the essential authority of government to maintain peace and security, and to enact laws for the promotion of the health, safety, morals and welfare of those subjéct to its jurisdiction. This limitation has had abundant illustration in a variety of circumstances. Thus, in addition to upholding the power of the State to require reasonable maximum charges for public service. (Munn v. Illinois, 94 U. S. 113; C., B. & Q. R. R. Co. v. Iowa, 94 U. S. 155; Railroad Commission Cases, 116 U. S. 307; Willcox v. Consolidated Gas Co., 212 U. S. 19), and to prescribe the hours of labor for those employed by the State or its municipalities (Atkin v. Kansas, 191 U. S. 207), this court has sustained the validity of state legislation in prohibiting the manufacture and sale of intoxicating liquors within the State (Mugler v. Kansas, 123 U. S. 623; Crowley v. Christensen, supra); in limiting employment in underground' mines or workings, and in smelters and other institutions for the reduction or refining of ores or metals, to eight hours a day except in cases of emergency (Holden v. Hardy, 169 U. S. 366) in prohibiting the sale of cigarettes without license (Gundling v. Chicago, 177 U. S. 183); in requiring the redemption in cash of store orders or other evidencés of indebtedness issued in payment of wages (Knoxville Iron Co, v. Harbison, 183 U. S. 13); in prohibiting contracts for options to sell or buy grain or other commodity at a future. time (Booth v. Illinois, 184 U. S. 425); in prohibiting the employment of women in laundries more than ten hours a day (Muller v. Oregon, 208 U. S. 412); and in making it unlawful to contract to pay miners employed at quantity rates upon the-basis of screened coal, instead of the weight *569of the coal as originally produced in the mine (McLean v. Arkansas, 211 U. S. 539).
The principle involved in these decisions is that where the legislative action is arbitrary and has no reasonable relation to a purpose which it is competent for government to effect, the legislature transcends the limits of its power in interfering with liberty of contract; but where there is reasonable relation to an object within the governmental authority, the exercise of the legislative discretion is not subject to judicial review. The scope of judicial inquiry in .deciding the question of power is not to be confused with the scope of legislative considerations in dealing with the matter of policy. Whether the enactment is wise or unwise, whether it is based'on soimd economic theory, whether it is the best means to achieve the desired result, whether, in short, the legislative discretion within its prescribed limits should be exercised in a particular manner, are matters for the judgment of the legislature, and the earnest conflict of serious opinion does not suffice to bring them within the range of judicial cognizance.
The principle was thus stated in McLean v. Arkansas, 211 U. S. 547, 548: “The legislature, being familiar with local conditions, is, primarily, the judge of the necessity of such enactments. The mere fact that a court may differ with the legislature in its views of public policy, or that judges may hold views inconsistent with the proppriety of the legislation in question, affords no ground for judicial interference, unless the act in question is unmistakably and palpably in excess of legislative power. [Cases cited.] ... If there existed a condition of affairs concerning which the legislature of the State, exercising its conceded right to enact laws for the protection of the health, safety or welfare of the people, might pass the law, it must be sustained; if such action was arbitrary interference with the right to contract or carry on business, and having no just relation to the protection of the public *570within- the scope of legislative power, the act must fail.”
In dealing With the relation of employer and employed, the legislature has necessarily a wide field of discretion in order that there may be suitable protection of health and safety, and that peace and good order may be promoted through regulations designed to insure wholesome conditions of'work and freedom from oppression. What differences, as to the extent of this power, may exist with respect to particular employments, and how far that which may be authorized as to one department of activity may appear to be arbitrary in. another, must be determined as cases are presented for decision. But it is well established that, so far as its regulations are valid, not being arbitrary or unrelated to a proper purpose, the legislature undoubtedly may prevent them'from being nullified by prohibiting contracts which by modification or waiver would alter or impair the obligation imposed. If the legislature may require the use of safety devices, it may prohibit agreements to dispense with them. If it may restrict employment in mines and smelters to eight hours a day, it may make contracts for longer service unlawful! In such case the interference with the right to contract is incidental to the main object of the regulation, and if the power exists to' accomplish the latter? the interference is justified as, an aid to its exercise. As was pointed out in Holden v. Hardy, supra, 169 U. S. on page 397: “The legislature has also recognized the fact, which the experience of legislators in many States has corroborated, that the proprietors of these establishments and their operatives do- not stand - upon an equality, and that their interests are, to a certain extent, conflicting. The former naturally desire to obtain as much labor as possible from their employés, whiler .the latter are often induced by the fear of discharge to conform to regulations which their judgment, fairly exercised, would pronounce to be detrimental to théir health or *571strength. In other words, the proprietors lay down the rules and the laborers are practically constrained to obey them. In such cases self-interest is often an unsafe guide, and the legislature may properly interpose its authority. . . . But the fact that both parties are of full age and competent -to contract does mot necessarily deprive the State of the power to interfere where the parties do not stand upon an equality, or where the public health demands that one party to the contract shall be protected against himself. ‘The State still retains an interest in his welfare, however .'reckless he may be. The whole is no greater than the sum of all the parts, and .when- the individual health, safety and welfare áre sacrificed or neglected, the State must suffer.’ ”
Here there is no question as to the validity of the regulation or as to the power of the State to impose the liability which the statute prescribes. The statute .relates to that phase of the relation of master and servant which is presented by the case of railroad corporations. It defined the liability of such corporations for injuries resulting from negligence and mismanagement in the use and operation of their railways. In the cases within'its purview it extended the liability of the common law by abolishing the fellow-servant rule. Having authority to establish this regulation, it is manifest that the legislature was also entitled to insure its efficacy by prohibiting contracts in derogation of its provisions. In the exercise of this power, the legislature was not limited with respect either to the form of the contract, or the nature of the consideration, or the absolute or conditional character of the engagement. It Was as competent to prohibit contracts, which on a specified event, or in a given contingency, should operate to relieve the corporation from the statutory liability which would otherwise exist as it was to deny validity to agreements of absolute waiver.
. The policy of the amendatory act was the same as that. *572of the original statute. Its provision that contracts of insurance relief, benefit or indemnity, and the acceptance of such benefits, should not defeat recovery under the statute, was incidental ‘to the Regulation it was intended to enforce. Assuming the right of enforcement, the authority to enact this inhibition cannot be' denied. If the legislature had the power to prohibit contracts limiting the liability imposed, it certainly could include in the prohibition stipulations of that sort in contracts of insurance relief, benefit or indemnity, as well as in other agreements. But if the legislature could specifically, provide that no contract'for insurance relief should limit the liability for damages, upon what ground can it be said that it was beyond the legislative authority to deny that Affect to the payment of benefits, or the acceptance of such pay- , ment, under the contract?
The asserted distinction is sought to be based upon the fact that under the contract pf membership the employ^ has an election after the injury. But this circumstance, however appropriate it may be. for legislative consideration, cannot be regarded as defining a limitation of legislative power. The power to prohibit contracts, in' any case where it exists, necessarily implies legislative control over the transaction, despite the action of the parties. Whether this control may be exercised in a particular cage depends upon the relation of the transaction to the execution of a policy which the State is competent to establish. It does not aid the argument to describe the defense as one of accord and satisfaction. The payment of benefits is the performance of the promise to pay contained in the contract of membership. If the legislature may prohibit the acceptance of the promise as a substitution for the statutory liability, it should also be able to prevent the like substitution of its performance.
For the reasons we have stated, the considerations which properly bear upon the wisdom of the legislation *573need not be discussed. On the one hand it is said that the Relief Department is in the control of the corporation; that by reason of their exigency the employés may readily be constrained to become members; that the relief fund consists in larger part of contributions made from wages; that the acceptance of benefits takes place at a time when the employé is suffering from the consequences of his injury and, being seriously in need of aid, he may easily be induced to accept payment from the fund in which/by reason of his contributions, he feels that he is entitled to share; and that such a plan, if it were permitted through the payment of benefits to result in a discharge of the liability for negligence, would operate to transfer from the corporation to its employés a burden which, in the interest of their protection and the safety of the public, the corporation should be compelled to bear. On the other hand it is urged that the relief plan is a beneficent scheme , avoiding the waste of litigation, securing prompt relief in case of need due to sickness or injury, making equitable provision for deserving cases, and hence tends in an important way to promote the good of the service and the security of the employment. Even a partial statement of these various considerations shows clearly that they are of a character to invoke the judgment of the legislature in deciding, within the limits of its power, upon the policy of the State. And, whether the policy declared by the statute in question is approved or disapproved, it cannot be said that the legislative power has been exceeded either in defining the liability or in the means taken to prevent the legislative will, with respect to it, from being thwarted.
The second ground upon which the statute, as amended, is assailed is that it constitutes a denial of the equal protection of the laws.
It is urged that the prohibition of the amendatory act applies only to those employés of railroad corporations who were embraced within the provision of the original *574statute, and to the enforcement of the particular liabilities which that statute defined. The limitation to a particular class of employés of railroad corporations is based upon the decisions of the state court that the benefits of the original statute were confined to those who were engaged in the hazardous business of operating railroads. Deppe v. Railroad Co., 36 Iowa, 52; Malone v. Railway Co., 65 Iowa, 417; Akeson v. Railway Co., 106 Iowa, 54. It is said that all employés of the plaintiffs in error may become members of the Relief Department and that the limited application of the amendment, as to the effect of the acceptance, of benefits under the membership contract, is an invalid discrimination.
It was, however, entirely competent for the legislature in enacting the prohibition, for the purpose of securing the enforcement of the liability it had defined, to limit it to those cases in which the liability arose. As the purpose of the amendment was to supplement the original statute, the classification was properly the same. And with respect to subsequent transactions the amendment must be regarded as having the same validity as it would have had if it had -formed a part of the earlier enactment. No criticism on the ground of discrimination can successfully be addressed to the amendatory act which would not likewise impeach the statute in'its earlier form.
But the propriety of the classification of the original statute was considered and upheld by this court. And the validity of legislation abrogating the fellow-servant rule, both with respect to the class of cases embraced in the statute, and also where it is abolished as to railway employés generally, has been-sustained. Minneapolis & St. Louis Ry. Co. v. Herrick, supra; Missouri Railway Co. v. Mackey, supra; Louisville & Nashville R. R. Co. v. Melton, 218 U. S. 36; Mobile, Jackson & Kansas City R. R. Co. v. Turnipseed, ante, p. 35. In view of the full discussion of this subject in the recent decisions *575above cited, nothing further need be said upon this point.
We find none of the objections which have been made to the validity of the amendatory act to be well taken, and the judgment is, therefore,
Affirmed.