Mr. Justice Miller
delivered the opinion of the court.
The appellants, who were complainants below, are trustees in a mortgage made by the Burlington and Southwestern Railway Company on its road and other property to secure $1,800,000 of bonds put on the mai-ket and sold. They instituted this foreclosure suit against the company, and brought in, during its progress, other parties who were asserting mechanics' liens on the road. Of these parties only the interest of O'Hara Brothers and Wells, French, & Co., whose liens were by the court held to be paramount to that of complainants; remain to be considered in the appeal of the trustees from that decree.-
The company was organized under the laws of Iowa to build a railroad from Burlington, on the Mississippi River, in a southwestern direction to some point on the Missouri River. From the initial point, at Burlington, to Yiele, in Lee County, Iowa, they by contract used the track of a road already built between Burlington and Keokuk. From Yiele to Bloomfield, in Davis County, they built and paid for their own track. From Bloomfield to Moulton, in Appanoose County, fourteen miles, they used the road of another company, already built, and from Moulton to Unionville, in Missouri, they built their own road. It is for the work and labor done and materials furnished on the latter piece of the road that the lien of the appellees was allowed by the court on the road and right of way, stations, &c., of the company from Viele Junction, in Lee County, to the South Iowa State line, in Appanoose County, in favor of O'Hara Brothers for $39,763.24, and in favor of Wells, French, & Co., for $8,528.83.
It is conceded that the work for which these liens were allowed was done for the company by the parties claiming them, and no question is raised here as to its value, or to the liability of the company to pay for it. The fact is undisputed that before any of it was done, or the contract therefor made, the mortgage to the complainants had been executed and duly recorded.
It,was also undisputed that both the appellees, whose claim is now contested, were sub-contractors, and that the only contract which the railway company made for labor and materials was with another organization, known as the Mississippi and Missouri Construction Company.
This purely artificial being, composed of the officers and some of the stockholders of the railway company, was organized for the purpose of building this road. It belongs to a class of corporations which have become well known of late years as instruments to enable the officers of railroad companies to make contracts with themselves to build the roads for their stockholders. In the present case, this construction company having sublet all the contract to one J. W. Barnes, very soon took itself out of the way, and by an agreement between it and the railway company, of which the following extract is found' in the record, its existence ceases to be of any further significance in this contest: —
" Contract between JB. <S¡ S. W. Railway Company and the M. & M. Construction Company. Dated Feb. 6, 1873.
" The railway company assumes all outstanding liabilities of the construction company, except officers' salaries. All previous contracts between the two companies are annulled.
" The railway company assumes the contract of J. W. Barnes for construction of portions of the main line and branch of the B. & S. W. Railway Company, and the payment of all estimates due and to become due thereon."
This leaves to be considered here the railway company, J. W. Barnes, the principal contractor for construction of the road, O'Hara Brothers, and Wells, French & Co., sub-contractors, and the complainants. It is also to be observed that before the present foreclosure suit was begun O'Hara Brothers and Wells, French & Co. had both commenced legal proceedings in the proper courts of the State, and had, after a contest with the railway company, obtained judgments establishing their liens. It was after this that they were made defendants to this suit.
To those proceedings, Barnes, the principal contractor, and the railway company were parties, and we take it for granted that as against them the judgments establish the validity of the liens. The judgments do not bind the appellants as they were not parties thereto. The validity of the liens as against them, and if valid, their precedence to that of the mortgage, are the questions for consideration here, and they must be determined by applying the statutes of Iowa to the facts of this case.
By the law in force when these transactions took place a mechanic has, for labor done or things furnished, a lien on the entire land upon which the building, erection, or improvement was made, which has been held to include railroads, and it shall be preferred to all other liens and incumbrances which shall be attached to or upon such building, erection, or other improvement made subsequently to the commencement of said building, erection, or other improvement. Revision of 1860, sect. 1858; Code of 1873, sect; 2139.
This provision,- it will be observed, relates to the land on which the improvement is made and gives the mechanic a paramount or preferred lien only as against other liens and incumbrances created subsequently to the beginning of - his work. Those made prior to that time are unaffected by it. But sect. 1855 of the Revision, now sect. 2141 of the Code, makes a different provision in regard to his lien on the building, erection, and improvement for which the lien is claimed. It reads thus.: —
"The lien for the things aforesaid on work shall attach to the building, erections, or improvements for which they were furnished or done, in preference to any prior lien or incumbrance or mortgage upon the land upon which the same is erected or put, and any person enforcing such lien may have such building, erection, or other improvement sold under execution, and the purchaser may remove the same within a reasonable time thereafter."
. The mechanic, therefore, has a lien upon the land paramount to all rights accruing after the commencement of his work, and upon what he puts upon the land paramount to all other claims, whether created before or after that time. The decisions of the courts of Iowa are to this effect and the proposition is not disputed in argument here.
Have the sub-contractors in this case taken the necessary steps to establish their lien ?
What is required to initiate the lien as to all other persons but sub-contractors is to be found in sect. 1851 of the Revision of 1860.
" Sect. 1851. It shall be the duty of every person, except as has been provided for sub-contractors, who wishes to avail himself of the provisions of this chapter, to file with the clerk of the district court of the county in which the building, erection, or other improvement to be charged with the lien is situated, and within ninety days after all the things aforesaid shall have been furnished, or work or labor done or performed, a just and true account of the demand due or owing to him after allowing nil credits, and containing a correct description of the property to be charged with said lien and verified by affidavit."
This section was subsequently modified by the following statute : —
" An act to amend sect. 1851 of Revision of I860, relating to Mechanics' Liens.
" Sect. 1. Be it enacted by the General Assembly of the State of Iowa, that the following words are hereby added to sect. 1851 of Revision of 1860, to wit: 'But the failure to file the claim, account, settlement, or demand, in the time named in this section and in sect. 1847, shall not operate to defeat the claim or demand, nor the lien of the person supplying the labor or material, as against the owner, nor the contractor, nor as against any one except purchasers or incumbrancers, without notice, whose rights accrued after the ninety days and before the account, or settlement,' or claim, or lien is filed.'
"Approved April 7, 1862."
The statute, however, makes provisión that a sub-contractor who shall do the work which his principal had contracted to do shall by proper proceeding secure to himself the lien which arises from the work done or materials furnished. In such case there^is a more complex affair. There are here the owner of the property, the principal contractor, and the sub-contractor, who, as well as prior and subsequent incumbrancers or lien holders, have rights to be affected. It may generally be supposed that the principal contractor has sublet his contract so as to leave a profit to himself. He is entitled, therefore, to see that his sub-contractor does not take this profit. The owner is not bound for more than he agreed to pay the principal contractor. In view of these interests, sect. 1847 of the Revision, sect. 2131 of the Code of 1873, enacts that every sub-contractor wishing to avail himself of the benefit of the act, shall give notice to the owner of the land, before or at the time he furnishes any of the materials or performs any of the labor, of his inten tion to perform or furnish the same, and afterwards he shall settle with the contractor therefor, and having made the settlement in writing, the same, signed by the contractor and certified by him to be just, shall be presented to the owner. He is also required, within thirty days from the time the things shall have been furnished or the labor performed, to file with the clerk of the district court of the county in which the building is situated a copy of said settlement, and a correct description of the property to be charged with the lien, the correctness of which shall be verified by oath. '-As we have ali'eady seen, the act of 1862 declares that a failure to file this settlement shall not operate to defeat the lien as against any one except purchasers or incumbrancers without notice, whose rights accrued after ninety days, and before the account or settlement or lien claim is' filed.
Appellants are not within this exception.
The record shows that there was filed in the office of the clerk of the District Court of Appanoose County, on the 31st of October, 1872, a statement by O'Hara Brothers of a claim against J. W. Barnes, the principal contractor, and against the railroad company, of a mechanic's lien on their line of said road, from Yiele, in Lee County, through Yan Burén, Davis, and Appanoose counties, in the State of Iowa, for work and labor done and to be done' and materials furnished under Barnes's contract, in which they said they had already done work to the amount of $265,000, of which $130,000 had been paid. This was verified by the oath of O'Hara. An agreed statement of facts in the present suit states that, in filing their respective claims for mechanics' liens, settlements had been made between the sub-contractors and Barnes, and that the amounts claimed had been agreed to by Barnes in these several settlements.
It is now urged by appellants against the validity of these liens that the notice of the lien to the railway company, which the statute required from the sub-contractor, was never given, and if any direct written notice was necessary to the establishment of the lien in this suit it must be admitted that it is not proved.
But we think there are two sufficient answers to this objection : —
1. It is obvious that tbis notice- to the owner of the property is for the purpose of enabling him to protect himself in his dealings with the principal contractor, so that he shall neither overpay the amount of the contract with the sub-contractor, nor embarrass himself by having to deal with two contractors. This dealing with two contractors instead of one being an obligation which the law imposes on him for the benefit of the sub-contractor, this notice is required for his protection. It' can have nothing to do with the validity of the lien beyond ascertaining the amount of it to which the sub-contractor is entitled as between those three. With prior liens it has nothing to do, and can have no effect on the rights of the holders of them. The initial proceeding for the establishment of the lien, on which all others rest, is the claim filed in the clerk's office of the-proper court. In the case of Bundy v. The K. & D. M. R. Co. (49 Iowa, 207), the Supreme Court of the State held that the paper thus filed by a sub-contractor imparted notice to the owner and principal contractor of the condition of the account between the parties.
2. Since this notice is designed for the protection of the owner, and was to be given to him, the judgment of the State court of Iowa establishing this lien against the railroad company is conclusive on that subject, and with that question the complainants in this court have nothing to do.
The next objection very strongly urged by counsel for appellants is thus stated in the assignment of errors: The court erred in decreeing a lien on the property in Davis, Yan Bufen, and Lee counties, the first division of the road, for work done in Appanoose County, the next division, on a contract which was dated and work begun after recording the mortgage in the-latter county.
As we understand this objection, it is founded on the idea that while, if the whole road had been uninterruptedly built under one contract, the lie.n of the contractors and sub-contractors would have been good against the whole road, though they had contributed only to the building of a limited portion of it, yet because these sub-contractors were only employed on one division of the road, after another had been finished, and under. a distinct contract with the company made after that completion, the lien can only attach to the last section of the road, and even this is subordinate to the mortgage of the appellants.
One branch of the question here raised was very fully considered in the case of Neilson v. Iowa Eastern Railway Company, 44 Iowa, 71. That was a case where, after the building of a railroad had been commenced, a mortgage was executed on its whole line, both where work had been done and where none had been done. After this the building of the road was continued under new contracts by persons who did work on the other parts of the road, and the question was whether they had any lien prior to that of the mortgage, and if so, whether it extended to all the road or only to that part built under the new contracts. • .
The court, after mature deliberation, decided both these questions in favor of the contractors. It held that the road was an entire improvement, within the meaning of the act, and that the continuance of it was a matter to be taken into the calculation of the mortgagees when the mortgage was made, and the lien for that work was by the statute given on the road as pne improvement. The court, speaking of the policy of the statute, said " it is' not desirable that the execution of a mortgage upon land on which a building or other improvement is in process of construction should arrest the work and prevent its completion. Both mortgagor and mortgagee are interested in its completion. Without it the money already expended must ordinarily to a great extent be lost. Take the present case as illustrative. The interveners are holders of mortgage bonds upon a road, sixteen miles of which had been graded at the time the mortgage was made. The value of their security depended upon the further construction of the work. They foresaw that work and materials must be furnished by somebody, or nothing could be realized from what had been done."
. But the argument most confidently urged here is that the road was built in sections, and that there was such- a separation in space and time in the construction of them that they cannot be considered as one improvement within the meaning of the statute. The argument is that the road from Yiele to Bloomfield is one road; that then it is interrupted, and the track of another company is used from Bloomfield to Moulton; that there another road begins which was constructed under another contract, and that no lien for work done here can attach to the road between Viele and Bloomfield.
The argument seems to us extremely technical, and at war with the principle in which liens are allowed for work done subsequently to the creation of a mortgage. That doctrine, or rather the statute which the courts construed as giving a permanent lien under such circumstances, was in existence when the mortgage of the appellants' was made. It entered into and became a part of their contract. They knew that the road was yet.to be built, and that while such building would add to the value of their' security, the law gave to the men whose labor and money built it a lien superior to that of the mortgage.- Now that the venture in which both embarked is to end in loss to one or the other of them, there is no judicial propriety in straining the law to limit the rights of one party rather than those of the other. If that law by its fair construction gives the mechanic a lien for a few thousand dollars on tlie whole road, instead of a part of it, the law should prevail.-
In every respect, except this one of its construction, the road is a unit, an entirety. Its route is selected and surveyed as one road. It is owned and built and run by one corporation. Its trains run over it all. The mortgage'of appellants can have no lien on any of the road beyond the first few miles upon any other theory, for its descriptive language refers to the road as one and not as several subdivisions. It is not easy to see how it can be held to be one road for the purposes of the mortgage, and two or three pieces of road for the purposes of the mechanics' lien. This continuation of the road beyond Bloomfield was as useful to the security of that mortgage as the -part between Viele and Bloomfield. ' Though the work was done from Moulton under another contract, there was never any suspension of the work on the whole road beyond what is usual in roads built with limited means. There was never any permanent arrest of the work, nor any intention to cease work on the road. The intersection of fourteen miles of another road between Bloomfield and Moulton does not destroy the identity of the improvement, nor convert it into .two railroads.
Canal Company v. Gordon (6 Wall. 561), is much relied on by appellants, and in one of its features, — that now under consideration, — it bears some analogy to this case. There, however, the part of the canal first finished, and which was held not to be subject to a lien for work done on that constructed afterwards, had been in full operation for some time. How long it had been finished and in use before work was begun on the new part is not stated in the report of the case. It may have been long enough to justify the belief that for a timé the further prosecution of the work was abandoned, and its resumption an afterthought.
In the case before us the purpose of discontinuing the road was never for a moment entertained, and the actual work was resumed in a few months after its completion to Bloomfield. In that case the decision depended on the construction of a statute of California which used the word " structure " where the Iowa statute uses the word "improvement."
In that case, as was said in the opinion, we had no aid from any decision of the courts of the State. In the one before us we have several decisions of the Iowa court. Neilson v. Iowa Eastern Railway Company, 44 Iowa, 71; Equitable Life Insurance Company v. Slye, 45 id. 615.
" A mechanic's lien," says the court in the latter case, " can, it is true, become paramount to a mortgage executed upon a partially erected building, provided the work be done or materials furnished for the purpose of completing the building. This is the plain provision of the statute, and, to our mind, it is not unreasonable. Whoever takes a mortgage upon a building in the process of erection, should assume that the mechanics' work is to go forward, and he may form some estimate of the amount that will be required. The same is not true in regard to repairs or enlargements."
If Canal Company v. Gordon, supra, is at variance with the decision of the courts of Iowa construing her own statute, we must follow the latter. They also meet our approval.
Without examining other objections to the decree, or those to the lien of Wells, French, & Co., we think what we have said covers the case.
Recree affirmed,