On July 26th, 1895, the plaintiff’s property, both real and personal, was injured by fire communicated by a locomotive engine in use by the defendant corporation, but, as is admitted, without fault or negligence on the part of the defendant. The plaintiff had insurance upon her property against fire under policies dated in March, 1895.
Pevised Statutes, c. 51, § 64, prior to the amendment of 1895, was as follows: “When a building or other property is injured *157by fire communicated by a locomotive engine, the corporation using it is responsible for such injury, and it has an insurable interest in the property along the route, for which it is responsible, and may procure insurance thereon.” Under this statute it was well settled that, in accordance with the doctrine of subrogation, an insurance company which had paid a loss upon property injured by fire communicated by a locomotive engine, could maintain an action in the name of the assured against the railroad corporation using the locomotive and recover the amount which it had been obliged to pay by reason of the contract of insurance.
But the legislature of 1895 amended this statute by adding thereto the following provision: “ But such corporation shall be entitled to the benefit of any insurance upon such property effected by the owner thereof less the premium and expense of recovery. The insurance shall be deducted from the damages, if recovered before the damages are assessed, or, if not, the policy shall be assigned to such corporation, which may maintain an action thereon, or prosecute, at its own expense, any action already commenced by the insured, in either case with all the rights which the insured originally had.” Chap. 79, Laws of 1895. •
In this case the insurance had been recovered prior to the assessment of damages by a referee, — the question as to whether the amount of insurance received by the plaintiff should be deducted from the damages being expressly reserved in the reference, and presented to this court upon an agreed statement of facts. The action is prosecuted for the benefit of the insurance companies, who had paid a portion of the loss, as well as for the plaintiff.
There can be no question as to the meaning of the amendment. It is expressly provided that the corporation liable for the injury by reason of fire communicated from its locomotive engine “ shall be entitled to the benefit of any insurance upon such property effected by the owner thereof,” and that the insurance “shall be deducted from the damages, if recovered before the damages are assessed.” The effect of the statute as it now stands is to make railroad companies liable in such cases for the difference only between the net amount of insurance recovered and the amount of *158the injury suffered by the property owner. Before the amendment, by reason of the statute liability, the railroad company was responsible to the owner of the property thus injured, notwithstanding that the property was fully insured, and notwithstanding that the owner had received full indemnity from the insurance company. But in the latter case, upon the equitable principles of the doctrine of subrogation, this responsibility of the railroad company to the owner inured to the benefit of the insurer. Since the amendment the liability is limited to the difference, as we have already seen.
But it is contended upon the part of the counsel for the plaintiff, representing .the interests of the insurers, that this amendment of 1895 is invalid because in violation of the last clause of the Fourteenth Amendment to the Federal Constitution: “Nor shall any State.....-deny to any person within its jurisdiction the equal protection of the laws.”
This clause has very frequently been before the Federal Supreme Court in attempts by unsuccessful litigants in the state courts to have legislative acts of almost every kind and unfavorable decisions of the state courts, held to be within the inhibition of this clause, and it has received so frequent judicial construction by that court that its meaning has become pretty well settled.
In Barbier v. Connolly, 113 U. S. 27, Mr. Justice Field, in delivering the judgment of the court, said: “The Fourteenth Amendment, in declaring that no state shall deprive any person of life, liberty or property without a due process of law, nor deny to any person within its jurisdiction the equal protection of the laws, undoubtedly intended, not only that there should be no arbitrary deprivation of life or liberty or arbitrary spoliation of property, but that equal protection and security should be given to all under like circumstances in the enjoyment of their personal and civil rights; that all persons should be equally entitled to pursue their happiness and acquire and enjoy property; that they should have like access to the courts of the country for the protection of their person and property, the prevention and redress of wrongs, and the enforcement of contracts; that no impediment should be interposed to the *159pursuits of any one, except as applied to the same pursuits by others under like circumstances; that no greater burdens should be laid upon one than are laid upon others in the same calling and condition......Class legislation, discriminating against some and favoring others, is prohibited; but legislation which, in carrying out a public purpose, is limited in its application, if within the sphere of its operation it affects alike all persons similarly situated, is not within the amendment.”
Legislation which is special in its character is not obnoxious to the last clause of the Fourteenth Amendment, if all persons subject to it are treated alike, under similar circumstances and conditions, in respect both of the privileges conferred and the liabilities imposed. Missouri Pacific Railway Co. v. Mackey, 127 U. S. 205.
Whenever the law operates alike upon all persons and property, similarly situated, equal protection cannot be said to be denied. Walston v. Nevin, 128 U. S. 578.
“ It merely requires that all persons subjected to such legislation shall be treated alike, under like circumstances and conditions, both in the privileges conferred and in the liabilities imposed.” Marchant v. Penn. R. R. Co. 158 U. S. 380.
“ There is no evasion of the rule of equality where all companies are subjected to the same duties and liabilities under similar circumstances.” Missouri Pacific R. Co. v. Humes, 115 U. S. 512.
In view of the construction which has so frequently been placed upon this clause by the IT. S. Supreme Court, is the act of 1895 within the inhibition of the clause? We think not. The law operates alike upon all persons and property similarly situated. The act is general in its terms and applies to all eases falling within its provisions. All persons and property subject to it are treated alike. The liability of the railroad corporation is the same, whatever the property injured or by whomsoever it may be owned. There is no unjust discrimination in the protection given by the statute between different persons or classes of persons.
It is argued, however, by the counsel for the plaintiff that an insurer has a vested interest in the property insured, “to a certain *160extent an ownership,” and that while the statute as amended furnishes full and absolute protection to the actual owner, it affords none whatever to the insurer, that therefore there is an unjust discrimination against a class of persons, viz, insurance companies, — corporations being undoubtedly persons within the meaning of the constitutional amendment.
But we think that the right which an insurer, who has paid the loss, has to prosecute for his own benefit any person, primarily liable to the assured for the injury, is not based at all upon the idea that he has a vested interest or any ownership whatever in the property insured, but rather upon the doctrine of subrogation, which is founded, not upon contract, but upon the relationship of the parties and upon equitable principles for the purpose of accomplishing the substantial ends of justice.
In accordance with these equitable principles, a surety who has been compelled to pay a debt for which another is primarily liable, succeeds to all the rights which the creditor had of enforcing the liability of the original debtor; or an insurer who has paid a loss for which another is responsible, either by statute or at common law, is subrogated to any claim that the insured had against the person whose tortious act caused the injury, or who for any other reason is liable to the owner therefor. If this were not so the very inequitable result would follow that an insured owner of property, for an injury for which another is liable would recover, for one and the same loss, full indemnity from the insurer and compensation from the person liable therefor.
“Subrogation is the substitution of one person in place of another, whether as a creditor or as the possessor of any other rightful claim, so that he who is substituted succeeds to the rights of the other in relation to the debt or claim and its rights, remedies or securities.” Jackson Company v. Boylston Mutual Insurance Co., 139 Mass. 508.
It necessarily follows from the very principles of this doctrine of subrogation that one cannot thereby succeed to or acquire any claim or right which the party for whom he is substituted did not have. A mere statement of this proposition is such that the cita*161tion of authority in support of it is not necessary, but ample authority is not wanting.
“ The party subrogated acquires no greater rights than those of the party for whom he is substituted.” Jackson Company v. Insurance Co., supra.
“ In any form of remedy, the insurer can take nothing by subrogation but the rights of the assured.” Phoenix Ins. Co. v. Erie Tran. Co., 117 U. S. 312.
“The right of the insurance company is a mere equity to be put in the place of the insurer .... whatever his rights may be.” Kernochan v. N. Y. Bowery Fire Ins. Co., 17 N. Y. 428.
The following cases are excellent illustrations of the doctrine of subrogation and of the proposition that the insurer by subrogation succeeds to such claims and rights as the person indemnified had, and to none other.
In the case of Simpson v. Thomson, Law Reports, 3 Appeal Cases, 279, decided by the House of Lords in 1877, an insured steamship was run down and destroyed by another steamship ; both vessels belonged to the same owner. The underwriters paid as for a total loss upon the steamship destroyed and sought to share with the owners of the cargo in a fund which the vessel owner had paid into court under an act limiting the liability of the ship owners. The Law Peers, who delivered opinions, all agreed that the question must be considered just as if the underwriters had brought an action against the owner of both vessels; and the House of Lords decided that, although the underwriters had paid for a total loss, and were entitled to all the rights in the injured ship which belonged to its owner, yet if that owner could not assert a claim for damages against the wrongdoers, neither could the underwriters ; that the underwriters’ claim must be asserted in the name of the insured and that any right of action that he had must be a right of action against himself, which is an absurdity, and thing unknown to law.
The Lord Chancellor, in delivering his opinion, said: “ I know of no foundation for the right of underwriters, except the well-known principle of law, that where one person has agreed to *162indemnify another, he will, on making good the indemnity, be entitled to succeed to all the ways and means by which the person indemnified might have protected himself against or reimbui’sed himself for the loss. It is on this principle that the underwriters of a ship that has been lost are entitled to the ship in specie if they can find and recover it; and it is on the same principle that they can assert any right which the owner of the ship might have asserted against a wrongdoer for damage for the act that has caused the loss. But this right of action for damages they must assert, not in their own name but in the name of the person insured, and if the person insured be the person who has caused the damage, I am unable to see how the right can be asserted at all.”
In Jackson Company v. Boylston Mutual Ins. Co., 139 Mass. 508, supra, the defendant insured the plaintiff on cotton in transit between different places in the United States and the plaintiff’s mills in New Hampshire. The contract for transportation with a carrier contained a stipulation, that “ the company [carrier] incurring such liability shall have the benefit of any insurance which may have been effected upon or on account of said cotton.” It was held, that it was no defense to an action on the policy for a loss insured against, that the insm'ed had, by contract with the carrier, given him the benefit of any insurance effected, if there was no fraud or concealment on the part of the insured in effecting the insurance, and if the policy of insurance contained no clause specifically subrogating the insurer to the rights of the insured in case of a loss through the fault of a carrier.
In Phoenix Ins. Co. v. Erie Western Trans. Co., 117 U. S. 312, supra, goods in transit were insured' by the plaintiff; a stipulation in the bill of lading allowed the carrier the benefit of any insurance procured by the owner. It was held that this stipulation was valid, although the loss was occasioned by the negligence of the carrier or his agents; and that in the absence of fraudulent concealment or misrepresentation, the insurer could maintain no action against the carrier upon any terms inconsistent with the stipulation. Mr. Justice Gray, in delivering the judgment of the court, used language that has a special significance with reference *163to tlie plaintiff’s contention in this case. “ That the right of the assured to recover damages against a third person is not incident to the property in the thing insured, but only a personal right of the assured, is clearly shown by the fact that the insurer acquires a beneficial interest in that right of action, in proportion to the sum paid by him, not only in the case of a total loss, but likewise in the case of a partial loss, and when no interest in the property is abandoned or accrues to him.”
These cases and many others which might be cited, many of which are collected in the last two cases referred to, clearly illustrate the principles of the doctrine of subrogation, and show that the rights of an insurer in no sense depends upon any vested interest or ownership in the property insured, but entirely upon the equitable rule that one who has indemnified a property owner against loss, should in case of loss and payment, either in full or in part, be allowed to succeed to whatever rights the owner had to the extent of such payment, against the person primarily liable therefor.
This clause in the insurance policies: “ If this company shall claim that the fire was caused by the act or neglect of any person or corporation private or municipal, this company shall, on payment of the loss be subrogated to the extent of such payment to all right of recovery by the insured for the loss resulting therefrom,” gives the insurers no greater right, in a case of this kind, than they would have had without it. Its only effect was to prevent the assured from releasing any claim that she had against any one responsible for the injury.
ft is further urged that the Act of 1895 can not affect the plaintiff’s right of recovery in this case, because otherwise it would impair the obligation of a contract; that it is not and was not intended to be retrospective. The plaintiff’s property was injured by fire on July 26th, 1895, some months after the Act of 1895 became effective by the expiration of thirty days after the recess of the legislature passing it. The insurance policies were dated in March, some time before the Act went into effect.
It is certainly true that the Act was not intended to be and is *164not retrospective. The limitation of liability does not apply to any case where fire was communicated by a locomotive prior to the time that the law went into effect. But was it not intended, and does it not apply to any injury thus caused afterwards? We think that such was the intention and that the Act does apply to this case. Nor can we see how it in any way affects or impairs the obligation of a contract. It undoubtedly very materially affects the rights of the insurer, but not his contractual rights. This was entirely within the province and power of the legislature. The liability of the railroad corporation was created by the legislature; it was not based upon negligence, but was placed rather as a condition upon its franchise. We have no doubt that the same power which created this unconditional liability could either limit or entirely take it away.
In Ewell v. Daggs, 108 U. S. 143, in which it was decided that a statute which repealed usury laws and destroyed defenses to existing contracts on the ground of usury, did not deprive parties of vested rights, nor impair the obligation of contracts, Mr. Justice Matthews in the opinion says, “ that the right of a defendant to avoid his contract is given to him by statute for purposes of its own, and not because it affects the merits of his obligation; and that, whatever the statute gives, under such circumstances, as long as it remains in fieri, and not realized, by having passed into a completed transaction, may by a subsequent statute be taken away.”
It would hardly be claimed for a moment that a property owner along the route of a railroad has a vested right in this statutory liability, however much he might be injured by its repeal, nor do we think that an insurer has any more reason' to complain of the unconstitutionality of the law. Certainly the state can not be said to have assumed any obligation, by the enactment of the original statute, to continue this liability of a railroad corporation without change beyond its pleasure.
It is said, however, that the clause in the policies, already quoted, gives to the insurer the right to be subrogated to this claim against a railroad corporation, as it existed at the time that the contract of insurance was made. If this were the object of the *165clause, we are unable to see how two persons can by contract continue the statutory liability of a third person, not a party to the contract, beyond such a time as the legislature may see fit, by enactment subsequent to the contract, to limit or repeal the liability. While the legislature cannot impair the obligation of the contract between the insurer and the insured, the parties to the contract cannot prolong the statutory liability of a third and independent person, when the legislature has seen fit to limit or repeal it.
But the clause relied upon does not go to the extent claimed by the counsel; it simply provides that if the insurance company shall claim that the fire was caused by the act or neglect of any other person, the company “ shall, on payment of the loss, be subrogated to the extent of such payment to all right of recovery by the insured for the loss resulting therefrom.” This cannot refer to any right of recovery by the insured before the loss; it is a right of recovery, “ by the insured for the loss,” — necessarily such right as the insured had at the time of the loss and afterward. This amendment in no way affected that provision in the policy. The insurance company after, as well as before the time when this law went into effect, had the right to be subrogated to all the right of recovery that the insured liad, and this independently of the contract, as we have already seen.
What this right of recovery was, that the insured had for a fire communicated from one of the defendant’s locomotives, but without fault or negligence upon the part of the defendant, depended upon the law as it was at the time of the fire. We have already seen that this right did not depend upon any interest or ownership of the insurer in the property insured, but rested entirely upon the equitable rule that one, who by reason of a contract, has been obliged to indemnify another against loss should succeed to all the rights that other had, to the extent of the amount paid, to recover of the person who for any reason was primarily liable therefor, but to no other nor greater rights than he had.
In this connection we again quote from the opinion of Mr. Justice Gray in Phoenix Ins. Co. v. Erie & Western Trans. Co., *166supra: “ But the insurer stands in no relation of contract or of privity with such person. His title arises out of the contract of insurance, and is derived from the assured alone and can only be enforced in the right of the latter.”
This right of subrogation remained in the insurer precisely the same after the act of 1895 went into effect as before. But in the meantime, between the making of the contract of insurance and the time of the fire, the plaintiff’s right had been limited to a recovery of the difference between the amount of the injury and the amount of the insurance received, thus indirectly affecting the insurer’s rights but not its contractual rights.
Our conclusion is that the Act of 1895 is not in violation of any provision of the Federal Constitution, and that it does apply to this case. From the amount of damages assessed by the referee there will, therefore, be deducted the insurance received by the plaintiff, less the premium paid and the expense, if any, of the recovery of insurance. The plaintiff will be entitled to judgment for this difference, together with interest thereon as provided by law.
Judgment accordingly.