delivered the opinipn of the court.
*97The Electric Transmission Company of Virginia, hereafter called the owner, entered into a contract with Jewell & Son Company (a corporation), hereafter called the contractor, for the construction of an addition to the owner’s power plant at “The Pocket,” in Lee county, Virginia, for the sum of $54,800.00. The contractor was required to give bond for the faithful performance of its contract. It gave such bond in the penalty of $55,000.00, with the Aetna Accident and Liability Company, of Hartford, Conn., hereafter called the surety, as its surety, conditioned to indemnify the owner “against any loss directly arising by reason of the failure of the principal (contractor) to faithfully perform said contract.” The bond further provides, “that in the event of any default, the surety shall have the right at its option to proceed, or procure others to proceed, with the performance of such contract; that if the surety does proceed or procure others to proceed with the performance of such contract any and all monies or property that may at the time of such default be due, or that thereafter may become due to the principal (contractor) under said contract shall become payable to the surety and shall be paid to it; and the surety shall be subrogated to all of the rights of the principal (contractor). The contractor, after having partly performed its contract, abandoned it. At the time of such abandonment $38,824.61 had been paid on account of the gross contract price of $54,800.00. The owner had the right to retain a certain proportion of the amounts falling due from time to time to the contractor under the contract until it had been fully performed, and had retained the sum of $4,127.88 of these partial payments. The surety, when notified of the contractor’s default, exercised its option to proceed itself with the completion of the contract, and thus entitled itself to collect the resi*98due of the contract price which otherwise would have been due by the owner to the contractor. The surety procured the completion of the building at a cost greatly exceeding the balance due by the owner on the original contract price. At or after the time when the contractor defaulted, a number of mechanics liens were filed by the subcontractors who had furnished labor and material for the structure. Before the contractor abandoned the work, he borrowed $1,500.00 from the Pennington Gap Bank, and secured it by deed of trust on certain machinery, appliances and material which were then in use or about to be used by the contractor, and were at that time on the premises. This deed was recorded on the 12th day of February, 1917, and before the surety exercised its option to take possession of such property and complete the contract.
The Norton Hardware Company levied an attachment on February 7, 1917, on certain machinery and material of the contractor on the premises of the owner. At or about this time a receiver for the contractor was appointed in the Superior Court of Cincinnati, Hamilton county, Ohio, and by order of that court of the 13th day of February, 1917, the receiver was directed to transfer, assign and set over to the surety “all of the right, title and interest of the said The John A. Jewell & Son Company in and to its said contract with the said The Electric Transmission Company of Virginia, and that said The Aetna Accident and Liability Company, of Hartford, Connecticut, be empowered to exercise all rights that they may have under said application, contract and bond, and that said surety company be subrogated to all of the rights of the said The John A. Jewell & Son Company under said contracts.”
There are other incidental facts, but we believe that these are all that the record presents which are signifi*99cant. The controversy is not with the owner, but arises between the creditors of the contractor and the surety. These creditors assert liens either upon the property of their debtor, the contractor, or upon the fund due by the owner upon the completion of the work. On the other hand the surety denies the validity of all such claims, and asserts its right to all the machinery, appliances and materials of the contractor which were found on the premises, which it used in completing the contract, as well as to the entire balance of the contract price due by the owner on the completion of the contract.
The issues thus raised were referred to a commissioner, who reported that the claimants of such liens were entitled to be paid out of the balance due by the owner for the completion of the contract. As these claims aggregated $4,607.03, the balance, $15,975.39, due by the owner, is ample for their satisfaction.
There were exceptions to the report. The court disagreed with the commissioner and held that the mechanics’ liens were liens on the sum of $4,127.88 retained by the owner, that being the amount of the percentage which had been retained by the owner at or about the time of the default and when the mechanics’ liens were filed and perfected. It also adjudged that the debt of the Pennington Gap Bank, Incorporated, by virtue of its deed of trust, and the debt of the Norton Hardware Company, by virtue of its attachment, were valid liens against the sum just stated as due by the owner, as well as upon material and equipment found by the surety on the premises and used, which belonged to the contractor, which property was found to be worth at least the sum of $3,391.72. The report of the commissioner, except as modified by the decree, was confirmed, and judgments were entered *100against the owner in favor of the several claimants for amounts aggregating $4,127.88, so found to be due, as above stated, and for the balance then remaining due to the Pennington Gap Bank, which such fund was insufficient to satisfy, as well as for the costs, also gave judgment against the surety.
It is this decree which is here under review.
The assignments of error are nineteen in number, but they all depend upon the claim that the surety stands in the place of the owner, and is subrogated to .all of its legal rights as against these claimants. That inasmuch as it took a very much larger amount of its money than the balance which was due by the owner to the contractor on the original contract, to complete the building, therefore none of these claims can be paid out of the fund due by the owner, and that there is no fund out of which they can be paid. For this view, the case of Maddux v. Buchanan, 121 Va. 102, 92 S. E. 830, is cited. The rule there established is perfectly sound, and cannot now be fairly questioned. Indeed, it has since been made statutory by Code 1919, section 6432, which expressly provides that if the owner is compelled to complete his building in consequence of the failure or refusal of the general contractor to do so, the amount expended by the owner for such completion shall have priority over all mechanics’ liens which have been or may be placed on such building, either by the general contractor or any subcontractor. If, therefore, this surety of the contractor can be held entitled to all of the rights of the owner when it exercised its right to complete the contract, its contention is sound.
While this question appears never to have been raised in Virginia, there are precedents in other jurisdictions which clearly show that the contention is unsound.
*101The germ of the true rule here applicable is found in Heckmann v. Pinckney, 81 N. Y. 217, which shows that the sole purpose of the statutes limiting the liability of the owner to the contract price are for the protection of the owner. It is indicated by Cooley, J., in Knapp v. Swaney, 56 Mich. 345, 23 N. W. 162, 56 Am. Rep. 399, where it is said: “The relators step into the shoes of the contractors, and can claim nothing under the contract which Allen & Van Tassel (the contractors there) themselves could not have claimed.” This may be too broad a general statement, but it is strictly accurate as applied to those who have perfected statutory liens against funds arising out of the contract which, but for such liens, would be paid directly to the contractor.
Then in Harley-Reeves Construction Co., 68 N. Y. Supp. 195, 33 Misc. Rep. 626, the question was precisely raised, and this is said: “Many other cases have been cited to the point that when the owner elects to and does complete the contract for the contractor’s account, the prior mechanics’ liens are good only against the surplus of the contract price remaining unexpended after the contract is completed; but this is plainly not in point. The owner is of course only liable to the extent of the contract price. He cannot be made to pay double. No question in respect of the owner’s measure of liability to lienors is up here. The sole question is whether this surety who was by the contract liable with the contractor from the beginning for the carrying out of the contract, and who elected to and did complete the contract, as he had the right to do, does not stand in the same relation to prior liens as though he were the contractor. The contention on behalf of this surety defendant is that such a surety may step in clear of all previous liens or claims at whatever point *102the contractor may abandon the contract, and complete it. If this be so, contractors and sureties have a plain and sure way of colluding to swindle which has not hitherto been resorted to only because it has not been deemed to exist.”
This view is reiterated in the later case of Maneely v. City of New York, 105 N. Y. Supp. 982, 119 App. Div. 376. The gist of the case on this point is indicated by this paraphrase of the language there used: Doubtless the surety was under no legal obligations to the lienors to complete the work; but when it elected to •complete it as surety, to protect itself against liability on its contract of suretyship, it is in law deemed a completion by its principal, and the rights of the lienors attach to the fund upon the theory that it has been earned-under the contract in the performance of which they furnished labor or material. The liens cover monies due and to grow due under the contract. If then the principal had completed, he would not have been entitled to the balance until the liens were paid, so, therefore, when the surety completes as such, under the same contract, it merely steps into its principal’s shoes, and is entitled to receive what the latter would have received had he completed, and in any view of the evidence that is all that the owner agreed to give him.
We heartily approve this conclusion, as effectuating the true purpose of the Virginia mechanics’ lien statutes. The surety involved here was under obligation to the owner to indemnify him for any loss which might be sustained because of the contractor’s default, but was under no obligation to complete the contract. It was, however, expressly given the option so to do. When it exercised this option it took certain benefits given by its agreement with the contractor; among them were the *103right to use the contractor’s appliances and materials (subject of course to superior rights, if any), and the right to collect of the owner any balance found to be due on the completion of the contract. Using the language expressed in the bond and in the assignment of the receiver of the contractor, the surety was subrogated to all of the rights of the defaulting contractor when it undertook the completion of the contract. It cannot, however, take the benefits and repudiate the burdens thereby imposed. It stepped into the shoes and took the place of the defaulting contractor so far as this contract was concerned. In this litigation its relation to these claimants is identical with that of the contractor—that is to say, neither it nor the contractor could collect the entire balance due on the contract from the owner without first providing for the payment of valid liens. Its relation to the owner is also identical with that of the original contractor, and in case such liens were unprovided for, it was the right as well as the duty of the owner to prevent any diversion of the funds from those who had perfected statutory liens upon the structure. Their right to have their liens discharged out of the unpaid balance in the hands of the owner is as clear against the surety as it would have been against the contractor principal.
What we have said relates directly to the mechanics’ liens. The Pennington Gap Bank, Incorporated, is entitled substantially to the relief which the trial court granted because it had a perfected and recorded lien, by deed of trust, upon the appliances and materials of the contractor before the surety acquired either possession or control thereof. We shall not cite the cases which show that the machinery and appliances of the general contractor as well as the materials purchased by him for use in a building belong to such con*104tractor until lie works them into the structure, or otherwise disposes of them. 9 C. J. 732, 816.
As against the lien of this deed of trust, it is claimed that because the agreement between the contractor and the surety authorized the surety to take possession of the contractor’s property on the premises for the completion of the contract, therefore this right supersedes the right of the bank under its recorded lien. No authority is cited for this contention, and we think it sufficient to say that it is in our judgment unsound. What the effect would have been if the agreement between the contractor and the surety had been first recorded it is unnecessary to consider. The deed of trust having been recorded before the surety took possession of the property, it clearly took subject to all of the rights of the lienor.
As to the claim of the Norton Hardware Company, which does not appear to have a mechanic’s lien, but to have levied an attachment on the 7th of February, 1917, upon the property of the contractor, the same principle applies. The lien of the attachment is superior to the right of the surety who took possession of the property after the levy of such attachment.
Another point which is urged is thus stated: “Appellants contend that when Jewell & Son abandoned the contract, The Electric Transmission Company had the right either to take the material and equipment of the contractors then on hand and complete the contract itself, and that if it did so it had the right to apply whatever funds were in its hands for the completion of the contract to the completion thereof; or that it had the right to call on Jewell’s surety, the Aetna Accident and Liability Company, to complete the contract, and if it did so, the surety was subrogated to the owner’s rights and itself had the right to use the material and *105equipment which Jewell had left on the premises, and to demand of the owner, The Electric Transmission Company, that it pay over to the surety whatever funds the owner had in its hands remaining to be applied to the contract.” Expressed differently, that the surety succeeds to all of the rights of the owner here.
We have already said, and this is clear, that the owner’s right fairly to use the balance due and to become due by it for the completion of the structure according to the contract, to the exclusion of the liens of these subcontractors, is clear and cannot be fairly questioned. We have also said that the surety succeeds to the rights of the contractor. We cannot consistently hold that such surety at the same time succeeds to all of the rights of the owner. The interest of the surety as the successor of the contractor is adverse to the interest of the owner, and it cannot succeed to such of the rights of the owner as are adverse to the rights of the contractor, and exercise both at the same moment of time. The right to stand in the shoes of the contractor and claim all of his rights and property is therefore inconsistent with the right to stand at the same time in the shoes of the owner and exercise all of his rights under the same contract. The argument in support of this contention is supported by a line of cases, which, however sound they may be, are inapplicable here. This case involves the right of the creditors of the contractor who claim specific liens given by statute, which liens had already attached, or could be asserted, when the surety assumed the completion of the contract.
The case chiefly relied on is Prairie State National Bank v. United States, 164 U. S. 227, 41 L. Ed. 412, 17 Sup. Ct. 142. It is there held that a surety who has completed an unfinished building contract has the right *106to a fund in the hands of the owner which is superior to the rights of an assignee of the defaulting contractor. This assignee, the bank, had an equitable assignment, which in terms entitled it to receive the final payment under the contract. There was no question there of mechanics’ liens, or liens of any other character, and the court merely held that under such circumstances the surety who being bound by his own contract of surety-ship had been forced to complete the contract, and thus directly supplied the consideration, had an equity superior to the bank, a volunteer.
Another case which is cited in support of .this contention is Hardaway v. National Surety Co., 211 U. S. 552, 29 Sup. Ct. 202, 53 L. Ed. 321. This case cites and follows the case just referred to, and it appears there affirmatively, among the facts, that the surety was compelled to pay into court a sufficient sum to discharge the liens, but was permitted to credit on this sum the amount which had been reserved by the owner under the original contract. It was held that the surety had the right of subrogation and was entitled to the fund, in preference to one who had advanced money to the defaulting contractor and taken an assignment from him. It is observed, also, that this case did not involve mechanics’ liens.
So of another ease relied on—First National Bank of Seattle v. City Trust Co., 114 Fed. 529, 52 C. C. A. 313. There it was held that a surety for a defaulting contractor, who completed his contract, had a right which was superior to the right of a bank under an- equitable assignment from the contractor, because the bank could take no greater right than its assignor, the contractor, could take. No case is cited which involves the right of persons having express liens either upon specific property, or upon funds in the hands of the owner, and *107none which sustains the contention here made for the appellants.
Many other pertinent authorities are collected in the note to Wasco County v. New England Equitable Ins. Co., 88 Ore. 465, 172 Pac. 126, L. R. A. 1918D 736, note, Ann. Cas. 1918E, 656.
It is said in Baugh & Sons Co. v. Black, 120 Va. 12, 90 S. E. 607, that the doctrine of subrogation has nothing of form or technicality about it. It is the creature of equity, and essential justice is its object. Bearing this succinct statement of the principle in mind, we find no merit in the contention that this surety should be relieved from the burden of its contract of suretyship, however heavily it may bear, at the expense of these lienors who have supplied it with the machinery and material which have enabled it to minimize its loss.
If anything further is -needed to sustain the decree, it is found in Acts 1895-6, p; 379 (Code, see. 6435), which preserves the validity and priority of the liens of laborers, mechanics and material men against assignments or transfers by a contractor either of any part of his contract with the owner, or of any money or consideration coming to him under such contract.
Here we have in effect just such an assignment to the surety by the general contractor effected by their agreement, under which the surety voluntarily took the chance of making the contractor’s profit in preference to permitting the owner to complete the construction contract.
Any other result here would defeat the manifest policy of the statutes enacted for the protection of those whose labor and property have contributed to the completion of the structure.
*108Our conclusion then is that the decree sufficiently protects and enforces the rights of the parties, and is right in its results; therefore, it will be affirmed.
Affirmed.
Burks, J., dissenting.