The original bill was filed by William H. Barnes and Henry Clews, as trustees in a mortgage executed on the first day of July, 1870, by the East Alabama and Cincinnati Railroad Company, to secure the payment of bonds to the amount of three millions five hundred thousand dollars, the company proposed to issue and negotiate, for *119the purpose of borrowing money to aid in the construction, completion, and equipment of a railroad from Eufaula to Guntersville in this State. The bonds were prepared with the view of obtaining the indorsement of the State, under the act of the General Assembly, approved February 21st, 1870 (Pamph. Acts 1869-70, pp. 149-157), as is shown by the bonds and the mortgage ; and in the mortgage, it is expressly recited and stipulated, that the title and lien thereby created is subordinate to the lien of the State, arising from its indorsement, declared by the act of the General Assembly aforesaid. The company issued and negotiated bonds, to the amount of seven hundred and five thousand dollars, of which only three hundred and ninety-five thousand dollars were indorsed by the State. It became bankrupt in 1873, and has been since in default in payment of the interest on the said bonds; and under proceedings in the course of bankruptcy, all its property had passed into the possession of purchasers of its equity of redemption. The mortgage provided, that if, for six months, the company was in default in the payment of principal or interest on said bonds, the trustees were to take possession, and make sale of the entire property mortgaged, which included all the property, rights, credits, and franchises of the company; and to apply the proceeds of the sales, first, to the liquidation and payment of the unpaid interest on the bonds, and then to the extinguishment of the principal.
In the progress of the present suit, a reference to the register was ordered, to ascertain and report the amount of the bonds of the company outstanding, indorsed by the State, and the amount of the bonds of tbe company outstanding not indorsed. Of the time and place of holding the reference, notice was given, and the holders of the bonds indorsed by the State appeared, and proved their claims ; and the appellants, holders of bonds not indorsed, also appeared, and made proof of their claims. The register made a report, showing the amount of principal and interest of each class of bonds, and who were the respective holders thereof; to which no exception was taken, and it was confirmed. Thereupon, the holders of the indorsed bonds presented to the chancellor a petition, averring they were entitled to be subrogated to the lien of the State, created by the act of the General Assembly, to which the lien and security of the mortgage was expressly made subordinate, and were, of consequence, entitled to be first paid from the proceeds of sale, and praying it should be so declared in the decree of foreclosure and sale. On the same day,of filing the petition, the chancellor rendered the final decree of foreclosure and sale, *120and declared that the holders of the bonds indorsed by the State were subrogated to the lien of the State, and must be first paid from the proceeds of sale, and so ordered and decreed the distribution of the proceeds of sale. From that decree, this appeal is prosecuted by the holders of the bonds not indorsed by the State.
To understand clearly the principal question involved, it is necessary to refer to the act' of the General Assembly. The first section declares, that the credit of the State shall be afforded to corporations then chartered to construct railroads within the State, upon conditions thereinafter expressed. The second section provides, that when a railroad company had finished, equipped, and completed twenty continuous miles of road, at or near either terminus, or at the intersection or crossing of any other railroad in operation on the line of said road, the governor, on the application of the company, should indorse on the part of the State the first mortgage bonds of the company, to the extent of sixteen thousand dollars per mile for that portion of the road thus finished, completed and equipped; and should make a like indorsement for each continuous section of five miles, subsequently finished, completed, and equipped. The third section declares, that when the indorsement is made; the indorsement itself “ shall constitute a first lien, upon the section or sections of said road as far as completed, including road-bed, superstructure, and equipment, and the franchises of the company granted by this ¡átate, or under its authority; and the State of Alabama, upon the indorsement of said bonds, and by virtue of the same, shall be invested with said lien or mortgage, without a deed from the company, for the payment by said company of said bonds, with the interest thereon, as the same becomes due ; and when the whole of said road shall be completed, the State of Alabama shall be invested with a first lien, without a deed from the company, upon the entire road in this State, and the franchises granted by this State, or under its authority, including the right of way, grading, bridges, masonry, rails, spikes, and joint-fastenings, and the whole superstructure and equipments, and all the property owned by the company as incident to, or necessary for its business, including depots and depot stations, and all other property, real and personal, belonging to said company, or hereafter to be acquired by them, for the payment of all of said bonds indorsed for the company, as provided in this act, and for the interest accruing on said bonds; and after the governor, on the part of the State, shall have indorsed any bonds as aforesaid, for any road making application therefor, under this act, it shall not be lawful for *121said company to give, create, or convey to any person or persons, or body corporate whatever, any lien, incumbrance, or mortgage of any kind, which shall have priority over, or come in conflict with the lien secured by this act; and any such lien, incumbrance, or mortgage, created after the passage of this act, shail be null and void as against such lien or mortgage of the State, as to any and all bonds so indorsed on behalf of the State under the provisions of this act; and the said lien or mortgage of the State shall have priority over all other claims existing or to exist against said company.” The tenth section declares, “ that this act shall be deemed and taken to be a public act as to all purposes.” The fourth, fifth and sixth sections provide for the seizure of' the road and all its assets by the governor, if at any time the company should make default in the payment of the interest on the bonds, and for a suit in chancery, in the name of the State, against the company, if default was made in payment of the principal when it became due.
It is obvious, if the company had executed to the State, for its security and indemnity, in the words of the statute, a mortgage, or a deed of trust, that all its property then held and owned, and all it subsequently acquired in its corporate capacity, with the franchise granted to it by the State, or under its authority, would have been included, and would have passed by the conveyance. No broader or more comprehensive terms could have been employed, than are found in the third section of the act, descriptive of and covering all the property it had capacity to acquire, whether such property was then existing, or subsequently acquired, including also the franchise it had derived from the State. If such mortgage, or deed of trust, had been executed, all who subsequently acquired any lien, or took any incumbrance upon the property or franchise, with notice of the prior mortgage or deed of trust, would take in subordination to it. The lien or mortgage (the terms are employed in tbe statute as synonymous) of the State is declared by the statute, which is a public act, and of itself operates as notice. The bonds issued by the corporation, indorsed, and unindorsed, refer to the act; the mortgage also refers to it, and declares that its security is in subordination to the lien of the State. The statute declares all other liens, incumbrances, or mortgages, created after the enactment, are void as against the lien of the State, and that “ the said lien or mortgage of the State shall have priority over all other claims existing or to exist against the said company.”
Liens in the nature of mortgages, created by statute, for the protection and indemnity of the State, are not infre*122quent in our legislation. They have not been regarded as of less force, or more limited in operation, than similar liens created by contract between individuals. In construing them, from the purpose for which they are created, and the terms employed in creating them, their scope and operation have been determined, as the scope and operation of a mortgage or other incumbrance would be ascertained. The Revised Code (§ 495) declared, that the bond of a tax-collector “ operates, from its execution, as a lien in favor of the State or county, on the property of such tax-collector, for the amount of any judgment which may be rendered against him in his official capacity, for State or county taxes, and on •the property of his securities from the date of his default.” Of the lien thus created, in Dallas County v. Timberlake, 54 Ala. 403, we said, that it was unlike that of a judgment or execution of a court of law, merely a creature of legislation, not ordinarily within the cognizance of a court of equity; “but a tax-collector’s bond being a contract, by which the law has previously declared liens shall be created, its liens are liens by contract, on the part of the persons who execute the bond, as much as that of a mortgage would be.” The same doctrine was asserted in Knighton v. Curry, 62 Ala. 404. If any other construction of statutes creating such liens was adopted, the security it is intended they shall afford the State would be diminished in value, and the purposes of their enactment defeated.
As we have said, a mortgage, or deed of trust, employing the terms found in the statute, would embrace not only so much of the road as was completed, finished and equipped, when the bonds of the company were indorsed by the State, but all its subsequently acquired property.— Galveston v. Cowdry, 11 Wall. 439; Meyer v. Johnston, 53 Ala. 237; S. C., at present term. For the security of the State against loss by its indorsements, the statute required that no indorsement should be made until twenty continuous miles of road had been finished, completed, and equipped;. and that subsequent indorsements should be made, only as five continuous miles were finished, completed, and equipped. But the lien of the State is not confined to the section of the road, for which the indorsement is made. No indorsement could be made for a section of less than five miles. A road may have been completed, the length of which would not have authorized indorsements for every mile or fraction of a mile; yet, on its completion, the State would haAre been invested with a first lien on the entire road in this State. An indorsement may, as in this case, have been obtained by a road completing a section of twenty miles, and another section of five miles, *123and then the enterprise may have failed, and been abandoned, a number of miles of the road less than five having been completed, for which no indorsement was obtained. Whenever an indorsement was obtained, the lien of the State attached, and attached not only to the road so far as completed, but to such parts of the road as were subsequently completed, and such property as was subsequently acquired, as it attached to the franchises of the company, which were incapable of division and separation, and of separate ownership. The very purpose of the statute, declared in its first section, was to afford railroad companies the high and superior credit of the State, to aid them in constructing their roads. A security commensurate with the great responsibility the State assumed in becoming the indorser and guarantor of their bonds, it was intended to provide, which should have priority over all other liens or incumbrances. That security would not be provided, if the narrow construction of the statute now insisted upon should be adopted, confining it to the particular sections of the road for which the indorsement may have been made.
The statute was framed with a knowledge of the mortgages railroad companies, in the incipiency of the enterprise in which they were engaged, were accustomed to execute, by which the whole undertaking, its existing and subsequently acquired property, and its franchises, were pledged to secure the payment of its bonds, issued and negotiated to raise money to aid in the construction and completion of the road. Such bonds could be, and were frequently executed; and without regard to the stage of the enterprise, when its bonds were issued and negotiated, the mortgage was an operative security for their payment, not only as to the road completed and property owned at the time of the negotiation, but as to all parts of the road subsequently completed, and property subsequently acquired. It was a lien and security of like kind the statute intended to furnish the State. Whenever the company made default in the payment of interest on the bonds indorsed by the State, whether the road was completed or unfinished, — whether there was an indorsement for more, or only twenty miles of the road, the governor was authorized to take possession and control of the railroad, and all the assets thereof, and to appoint a receiver, or receivers, who were to take its rents, issues, profits, and dividends. If the company refused to surrender possession, the govern- or was authorized to issue a warrant to the sheriff of each county, through which the road run, commanding him to LaJce possession of said road, fixtures, and equipments, and every thing appertaining thereto, and place the receiver in full and complete *124possession of the same: and said receiver so appointed shall continue in possession of said road, fixtures, and equipments, and run the same, and manage the entire road, dtc. The statute is general in its terms necessarily, and while some of its words, taken by themselves, may indicate that the lien of the State was limited to the section or sections of the road completed, for which the bonds of the company were indorsed, yet regard must be had to all its parts and clauses, and the intent which is found in them. It can not be supposed it was intended that the governor should, in the event of the default of the company, take possession of any property, or transfer to a receiver the possession of any property, on which the lien of the State did not operate. Whatever property the company had at the time of the default, the governor was bound to place in the possession of the receiver of his appointment; and thus there is a clear expression of the extent of the lien.
That from the time the first bond is indorsed by the State, a lien attached to the franchise of the company, is expressly declared. The franchise is an entirety — it does not attach to any particular part of the road, or by fractions or parcels. Taking it in the narrowest sense of the term, it is the right, derived from the charter, to construct and maintain the road in its entire'length, on the route designated in the charter, and to receive compensation for the transportation of persons or property over that road. There was no purpose to create a security on this franchise in favor of the State, and at the same time to limit the security to such parts of the road as were completed, and for which the State had indorsed the bonds of the company. We do not, therefore, assent to the argument of appellants’ counsel, that the lien of the State must be confined to the parts of the completed road for which the bonds of the company were indorsed. We are of the opinion, that by the indorsement of the bonds of the company, the State acquires a valid lien, having all the force, qualities, and incidents of a mortgage, superior to all other liens created after the enactment of the statute of February 21st, 1870, upon the railroad and all its corporate property, and its franchises.
The general principle, upon which the decree of the chancellor rests, has not been controverted, but is admitted by the appellants. It has been frequently the basis of decision in this court, and we state it in the terms generally employed : _ A' creditor is entitled to the benefit of all pledges, or securities, given to, or in the hands of a surety, for his indemnity; and this, whether the surety is damnified or not, *125as they are regarded as a trust created for the better secure ity of the debt.— Toulmin v. Hamilton, 7 Ala. 362; Ohio Life Ins. Co. v. Ledyard, 8 Ala. 866; Br. Bk. Mobile v. Robertson, 19 Ala. 779; Cullom v. Br. Bk. Mobile, 23 Ala. 797; Troy v. Shields, 33 Ala. 469; Saffold v. Wade, 51 Ala. 214. The surety has a corresponding equity. Whenever he pays the' debt, he is entitled to stand in the place of the creditor, as to all securities for the debt held or acquired by the creditor, and to have the same benefit from them as the creditor could have had, if he had chosen their appropriation to the payment of the debt, instead of calling upon the surety. — 2 Brick. Dig. 384, § 141. In Knighton v. Curry, supra, we held that the sureties of a tax-collector, on paying a judgment for the default of the principal, were entitled to be subrogated to the statutory lien of the State and county on the property of the principal.
When a branch of this cause was before this court, at a former term, we intimated, that the holders of the bonds indorsed by the State were entitled to be subrogated to the statutory lien of the State. — Kelly v. Barnes, 58 Ala. 489. While the appellants recognize this general principle, they insist that it has no application, and is incapable of just application to the lien the statute secures the State, which is purely personal to the State, intended only for its protection and indemnity, and not for the security of the bonds, or to create a fund for their payment. The question is not free from difficulty; and we were aware, when we formerly intimated that the holders of the indorsed bonds were entitled to subrogation to the lien of the State, of the distinction made by the authorities, between a mere personal indemnity to a surety, or an indemnity against a contingent liability, never becoming absolute, and a trust or security for the payment of the debt and the protection of the surety. We do not dwell upon or discuss now the extent of the distinction. By the express words of the statute, the lien of the State is declared to be “ for the payment by said company of said bonds, with the interest thereon, as the same becomes due and if the State, on the default of the company in paying interest, takes possession of the road, whatever is derived from its operation, after deducting expenses, is to be applied “ to pay and discharge the interest due on said bonds.” If this lien had been created in these terms, by mortgage, or deed of trust, we would have been compelled, under our former decisions, to pronounce that the creditor, whether he had knowledge of its existence or not, and whether the State had or not been damnified, was entitled to be subrogated to the security it afforded. Protection, indemnity to the State, *126is intended ; but it is to be afforded by the payment of the debt. When the debt is paid, the State is fuily protected, and ample protection the statute does not contemplate can be otherwise afforded. These bonds have gone out into the markets of the world, bearing the indorsement of the State, referring to the statute, inviting an examination of it, not only as the source of authority for an indorsement binding the State, but for the security the State had for the payment of the bond. They may have acquired value and currency because of this security, and there is no good reason, no substantial equity, for a narrow interpretation of the general words of the statute, converting it into a mere personal security for the State, incapable of enuring to the benefit of the creditor, instead of a security, in the words of the statute, for the payment by said company of said bonds, with the interest thereon, as the same becomes due.
The whole doctrine of subrogation rests upon equitable considerations and principles. The purpose, at last, is to make that thing or person bear a common burthen, which or who ought, in equity and good conscience, to bear it primarily, in relief or ease of another, only secondarily liable as between the two. Therefore it is that, generally, whenever a security is given by the principal debtor, either to the surety, or to the common creditor, for the payment of the debt, a court of equity will lay hold of it as a trust for the security of the debt, and will so execute the trust that the debt be paid. When the security is given to the surety, if the court subrogates the creditor to it, the surety is .benefitted — it is for his ease. He is relieved from the vexation of suit, from payment of the debt, or from resorting to the legal remedies against the principal, or remedies to make the security available. The liability of the principal is extinguished, to the extent of the security, and justice is done to all parties in interest. In Young v. M. &. E. R. R. Co., 2 Woods, 606, the Circuit Court of the United States decreed, that the holders of bonds indorsed by the State were entitled to be subrogated to the lien of the State, under the act of 1867, which does not differ from the act of 1870, in any respect now material.
Nor is it unjust to the holders of bonds not indorsed, to decree subrogation and priority to the holders of the indorsed bonds. These bonds were acquired with full knowledge of the priority of the State; and it must be presumed whoever acquired them, intended that his rights should be, as they were by the mortgage, secondary, or in subordination to the rights of the State ; and there is no equity in any claim now of equality with the holders of the indorsed bonds.
*127Upon decreeing a foreclosure and sale, after the amount of tbe mortgage debt had been ascertained, the chancellor, of necessity, must have determined and decreed the order in which these debts should be paid. No motion or petition was necessary to authorize the decree. It is not, therefore, important that a petition was filed invoking the decree, and that it was acted on without notice.
The decree is affirmed.