
    SEGOVIA DEVELOPMENT CORPORATION and Federal Insurance Co., Plaintiffs, Appellees, v. CONSTRUCTORA MAZA, INC., Jorge M. Guillermety, Banco de Ponce, Defendants, Appellants.
    No. 79-1663.
    United States Court of Appeals, First Circuit.
    Submitted May 6, 1980.
    Decided Aug. 25, 1980.
    
      Ismael H. Herrero, Jr., San Juan, P. R., Jose Raul Bigas, Hato Rey, P. R., Correa Calzada, Collazo, Salazar, Herrero & Lazaro Paoli, San Juan, P. R., Rodriguez-Ramon, Pena & Cancio, Hato Rey, P. R., on brief, for defendants, appellants.
    Francisco Castro-Amy, San Juan, P. R., on brief, for plaintiffs, appellees, Federal Ins. Co.
    Before CAMPBELL and BOWNES, Circuit Judges, and DAVIS, Judge, U. S. Court of Claims.
    
      
       Sitting by designation.
    
   DAVIS, Judge.

The question is whether the Puerto Rico law governing a surety’s right vis-a-vis the owner and contractor accords with that “widely applied in this country.” Pearlman v. Reliance Ins. Co., 371 U.S. 132, 137, 83 S.Ct. 232, 235, 9 L.Ed.2d 190 (1962). Holding that it did, the District Court ruled that a surety paying the laborers and material-men of its bankrupt contractor and performing its contractor’s other obligations to the owner has a right to receive reimbursement of the surety’s expenses from contract retainages which is superior to the right of the bankrupt contractor and its receiver in bankruptcy. We hold that the District Court properly granted summary judgment to the surety on this issue.

In December 1973, Constructora Maza, Inc. (Maza), the contractor, and Segovia Development Corporation (Segovia), the owner, entered into the construction contract which gave rise to this action. The construction was to be in Puerto Rico. At that time, Federal Insurance Company (Federal) issued pérformance and payment bonds guaranteeing to Segovia that the contract would be performed and all claims for labor and material incident to the construction would be paid. Housing Investment Corporation, the lender, agreed to the loan agreement and other agreements with the contractor; the lender was required to pay progress payments directly to Maza, and to retain a percentage of the estimated amounts due until completion and acceptance of the project.

As a result of financial problems, Maza filed a petition under Chapter XI of the Bankruptcy Act in March 1976. Because of these monetary difficulties, Maza failed to meet its contractual obligations to Segovia, and its payments due laborers, materialmen and subcontractors under that contract. By an order of the court in the bankruptcy proceedings, the construction contract was rejected and terminated. The order provided that “[r]etainages in said project should be retained subject to further order of this court * * and allowed Segovia and Federal to engage another contractor to finish the project. The retainage fund, which the District Court found totalled $423,630.03, is the subject of this action. Federal brought suit in Puerto Rico to recover that fund. It is undisputed that, in discharging its obligations under the payment and performance bonds, the surety expended funds greatly in excess of the retainage amount, and therefore, under the District Court’s ruling, Federal will be entitled to the whole fund.

Federal’s claim is based on its rights as subrogee of the owner, contractor, laborers and materialmen whom it paid or for whom it performed as Maza’s surety. The established rule of subrogation “widely applied in this country” is set forth in Pearlman, supra, 371 U.S. at 137, 83 S.Ct. at 235. It provides generally that “a surety who pays the debt of another is entitled to all the rights of the person he paid to enforce his right to be reimbursed.” Id. In Pearlman this rule controlled facts very similar to those in this suit, and resulted in a judgment in favor of the surety. Like this, that case involved “a dispute between the trustee in bankruptcy of a government contractor and the contractor’s payment and bond surety over which has the superior right and title to a fund withheld by the Government [the owner] out of earnings due the contractor.” Id. at 133, 83 S.Ct. at 233. When the contractor defaulted, the surety paid off the laborers and materialmen. The contract between the United States and the contractor authorized the Government to retain a percentage of monthly amounts due the contractor until final completion and acceptance of work under the contract.

The Supreme Court held that the surety’s rights to the retained funds were superior to those of the trustee in bankruptcy since the funds did not belong to or form part of the bankrupt’s estate prior to completion of the work contracted for. Id. at 136, 141, 83 S.Ct. at 234, 237. Rather, the retainages remained the property of the owner, and, by way of subrogation, became the surety’s property to the extent necessary to reimburse it for its payment of the laborers and materialmen and other costs of contract performance. Id. at 141, 83 S.Ct. at 237.

The District Court was right that “[b]y its facts, reasoning and holding Pearl-man is most persuasive.” The facts in Pearlman and this case do not differ in any material respect, and it follows that, if Puerto Rican law is in harmony with the prevailing rule regarding a surety’s right to subrogation set forth in Pearlman, then the District Court’s judgment in favor of Federal must be upheld.

Defendants, however, take the position that Puerto Rican subrogation principles are narrower than the general law stated in Pearlman. They contend that, because of the more limited rights of subrogation under Puerto Rican law, a trustee in bankruptcy (or a debtor in possession and receiver as is the case here), has a right to property of the bankrupt superior to the right of a subrogated surety. This argument comes from section 70(c) of the Bankruptcy Act, 11 U.S.C. § 110(c), which provides generally that if under local law a creditor (whether or not such a creditor actually exists) could have set aside a transfer of the bankrupt’s property through use of a judgment, an unsatisfied execution, or a lien on the bankrupt’s property, then the trustee may set aside the transfer. If any real or hypothetical creditor of Maza had a right under Puerto Rican law to the retainages at issue, which was superior to the surety’s, then Maza or its receiver could avail itself of these rights and claim the retainages. While we do not disagree with this interpretation of section 70(c), defendants’ argument fails because we find that, under the local law, no existing or nonexisting creditor of Maza has a better right to the retain-ages than Federal does.

Puerto Rican law defines by statute the subrogation rights available to sureties and others who provide security in a contractual context. See, e. g., Article 1721, et seq., Civil Code of Puerto Rico, 31 Laws of Puerto Rico Annotated § 4871 et seq. Of particular relevance are Articles 1737,1738 and 1166, 31 L.P.R.A. §§ 4911, 4912, 3250. Pursuant to Article 1737, “[a] surety who pays for a debtor shall be indemnified by the latter.” Article 1738 provides that a surety who pays for a debtor is “subrogated in all the rights which the creditor had against the debtor.” Article 1166 states that “[sjubrogation transfers to the subrogated the credit, with the corresponding rights, either against the debtor or against third persons, be they sureties or holders of mortgages.” Defendants concede that under these statutes Federal is subrogated to all the rights of creditors whom it paid under the payment and performance bonds, and, as such, Federal is generally subrogated to Segovia’s right to have the project completed, and to all the legal and contractual rights of Maza’s subcontractors, laborers and materialmen.

The critical issue concerns the precise rights held by these creditors who were paid by Federal. Did these rights exist before the bankruptcy and prevail over those of Maza? Puerto Rican law is plain that an attaching creditpr (here Maza and its receiver in bankruptcy, standing in the shoes of a hypothetical attaching creditor pursuant to section 70(c) of the Bankruptcy Act) cannot acquire more rights to a debtor’s (Maza’s) funds than the debtor itself possesses. See Empresas Capote, Inc. v. Superior Court, 103 D.P.R. 765, slip op. (translation) at 9 (1975); Armstrong e Hijos v. Inter-American Bldrs., Inc., 98 P.R.R. 720, 727 (1970). Defendants can establish a right to the retainages only if Maza, as a debtor-contractor, had a property interest in those funds at the time of bankruptcy— the time when a trustee in bankruptcy’s rights are determined — which was superior to the rights Federal acquired as surety and payor of the payment and performance bonds. We conclude, however, that the interests to which Federal was subrogated pre-dated the bankruptcy.

The first proposition to note is that, under the construction contract and Puerto Rican law, Maza did not acquire rights in the retainages until it paid the laborers, materialmen, and subcontractors, and performed its agreement with Segovia. The contract specified that Maza, the contractor, agreed to construct the building and to pay all subcontractors, laborers and materialmen. It was also agreed that 10% of all periodic progress payments would be retained. Article 9.7.3 of the contract’s general conditions provided that neither the final payment nor the retainages were due until proof was submitted that “all payrolls, bills for materials and equipment, and other indebtedness connected with the Work * * * have been paid or otherwise satisfied * * Under this provision, Maza could not acquire rights in the retainages until it met those obligations (which it never did). This contractual language is consistent with Puerto Rican case law dealing with the rights of unpaid laborers, materialmen and subcontractors to be compensated from retained funds upon the contractor’s failure to do so. See, e. g., M. Lamadrid & Co. v. Guerrero, 43 P.R.R. 951, 954-55 (1932); Inter-American Builders, supra, 98 P.R.R. at 727.

In Lamadrid, the Supreme Court of Puerto Rico found that retainages held by the government pursuant to a completed public road contract could not be attached by a creditor of the contractor because payment of laborers and materialmen was a condition of the contract, and this condition had not been met. Id. The court inferred from the contract that a purpose of retaining a percentage of the contract funds was to provide protection to laborers or material-men who were creditors of the contractor by reason of their provision of labor or materials in the construction of the road. Id. at 954. The court stated that:

Strictly speaking, it cannot be said that such funds belonged to the defendant [contractor]. They will be his property when he shows he has paid all the claims mentioned in the contract. * * * [If the contractor] cannot demand the payment of this sum, the plaintiff cannot do so either, merely by reason of the fact that it has obtained a judgment against the defendant. [Id.].

See also, Henningsen v. United States Fid. & Guar. Co., 208 U.S. 404, 28 S.Ct. 389, 52 L.Ed. 547 (1908). The current facts are analogous to those in Lamadrid. Defendant Maza and its receiver, by asserting the rights of a hypothetical creditor at the time of bankruptcy, cannot obtain through Maza, as contractor, any right to the retainages since -these are not Maza’s property until the contract conditions of payment by Maza for laborers and materials are met. Because Maza defaulted on these contract terms the retainages never became its property, and thus could not be attached by its outside creditors.

At least with respect to laborers and materialmen, defendants counter with the position that subrogation does not give the surety rights to funds on which another creditor has acquired rights prior to subrogation, and that subrogation occurs only when the surety pays its principal’s creditors. In this case, defendants’ argument is based on the assumption that, because no laborers or materialmen filed a direct action against the owner or contractor as they could have, see note 5, supra, their rights, and Federal’s rights as subrogee, are necessarily subordinate to the rights of Maza and its receiver under section 70(c) of the Bankruptcy Act. We have already rejected the contention that the existence of the direct-action statute reduces the laborers’ or materialmen’s rights, or those of the surety. See note 5, supra. Moreover, a crucial flaw in this argument, once again, is that contract retainages do not become the property of a contractor (like Maza) until contractual obligations such as payment of laborers and materialmen are met. See, Lamadrid, supra, 43 P.R.R. at 954-55. As observed earlier, under this contract retainages are not due until proof is given that such payments have been made. Such payment by Maza was never made here. Federal, on the other hand, has made such proof.

Defendants’ argument on this score is also contradicted by Empresas Capote, supra. In Empresas, plaintiff was the assignee of a contractor who had agreed to design a building for the local government. The contractor engaged a subcontractor to do part of the design work. Pursuant to the contract, payments to the contractor were to be held by a government agency and were to be made only if he submitted evidence that subcontractors had been paid. There was an attachment of the government-held funds by plaintiff’s assignor in 1969. In 1971, one of the subcontractors filed a complaint and also attached the funds. On these facts, the Supreme Court of Puerto Rico found that, even though the subcontractor’s attachment was not first in time, it was superior. Slip op. at 9-11. This result was mandated by the contract requirement that subcontractors be paid before the contractor could receive final payment. Id. Even though the funds could be and were attached by the plaintiff before liquidation, the attaching creditor could not obtain greater rights than its contractor-debtor. Id. at 10. Therefore, since after liquidation the funds did not belong to the contractor, the first attachment did not create any rights in plaintiff.

Defendants say that F. D. Rich Co. v. Superior Court, 99 P.R.R. 155 (1970), rather than Empresas Capote, is controlling. Rich held that, although the rights of a contractor to funds withheld by the owner under a construction contract were contingent, they could be attacked by a creditor. 99 P.R.R. at 172-73. Defendants interpret this holding to mean that funds in the possession of a general contractor may be attached by a creditor, and when attached, the creditor has rights over such funds which are superi- or to those of laborers, subcontractors, materialmen or a surety subrogated to their rights. However, that interpretation disregards the part of the holding which states that “[o]nee the work was terminated, * * * the contract between [the owner and the contractor] was subject to an adjustment of accounts, that is, to liquidation.” Id. at 170. It is clear that the court, consistent with its later decision in Empresas Capote, found that the attaching creditors’ rights were subject to final liquidation and accounting with the owner, and were limited to the amount actually due and payable to the contractor. Thus, any obligations of the contractor to subcontractors, materialmen, or laborers which were preconditions to the contractor’s receipt of contract funds would have to be satisfied before the remaining funds, if any, would become available for attachment. In short, Rich provides no support for defendants’ position, because, instead of recognizing in the contractor or general creditor any rights in contract balances superior to the owner’s, the court reaffirmed that those rights were contingent on full performance of the contract. Id. See also, Banco Popular v. Vazquez, 97 P.R.R. 155, 162-63 (1969).

This analysis of Puerto Rican law shows that it is in agreement with the reasoning and holding of Pearlman. Under both the general common and commercial law and under Puerto Rican law, laborers and materialmen have rights to contract retainages which are superior to those of general creditors, even where such funds have been attached by the outside creditor first. Since the surety is subrogated to these rights as a result of satisfaction of its payment and performance bonds, its rights are also superior to those of any general creditor or those who, like Maza and its receiver, assume the role of such a creditor through their status under the Bankruptcy Act.

It is also established that Federal is subrogated to any rights which the owner (Segovia) has against Maza, arising from Federal’s completion of the contracted-for construction. As we have pointed out, Federal, as surety, satisfied Maza’s debts and obligations under the contract and therefore it is also subrogated to any rights Maza, as a contractor-debtor, would have to the retain-ages.

In Sobrinos de Ezquiaga v. Heirs of Hatch, 38 P.R.R. 536 (1928), the Supreme Court of Puerto Rico held that a surety who completed the work of a defaulting contractor had a right to funds due under the contract, and that this right was superior to the rights of the contractor’s creditor who had previously attached the funds. Id. at 540 — 42. In reaching this conclusion, the court relied on statutes dealing with subrogation, and on general subrogation principles. Id. at 540-41. The court specifically referred to the Supreme Court case of Prairie State Bank v. United States, 164 U.S. 227, 17 S.Ct. 142, 41 L.Ed. 412 (1896). There, the Court held that subrogation entitled the surety to receive contract retainages since the surety, by making disbursements necessary to carry out the contract, freed the contractor from its obligations to do so. Id. at 239, 17 S.Ct. at 147. The Sobrinos court also cited Henningsen, supra, 208 U.S. at 411, 28 S.Ct. at 391, to the same effect. 38 P.R.R. at 541 — 42.

The same result was reached in American Fire and Casualty Co. v. First Nat’l City Bank, 411 F.2d 755 (1st Cir. 1969), cert. denied, 396 U.S. 1007, 90 S.Ct. 563, 24 L.Ed.2d 499 (1970). In that case, which was decided under Puerto Rican law, we held that the surety was entitled to be subrogated to the owner’s or contractor’s rights to unpaid contract balances and retainages, and that its right was superior to that of the bank to which the contractor had previously assigned the contract balances and retainages. The court held that the surety was entitled to the retainages since “[b]y its nature retainage is a security for protection against failure of completion.” Id. at 758.

Sobrinos, American, and the Puerto Rico Supreme Court cases, make it clear that, under Puerto Rican law, a surety is subrogated to the owner’s and contractor’s rights in contract retainages as a consequence of its performance of the contractual obligations of the contractor, and this right of subrogation is superior to .that of an attaching creditor, even where such a creditor has attached the retainages before subrogation occurs.

Accordingly, Federal’s rights as subrogee of the contractor, owner, laborers and materialmen are superior to defendants-appellants’, and the appeal must fail.

Affirmed. 
      
      . A trustee in bankruptcy has not been appointed. Together, the contractor and the receiver exercise powers equivalent to a trustee’s.
     
      
      . All references to the Bankruptcy Act refer to sections of that Act as they appeared prior to abrogation of the Act, and its substitution by the new Bankruptcy Code.
     
      
      . This appeal was brought by Maza, the contractor, and Guillermety, the receiver in bankruptcy, both defendants below. Banco de Ponce, as assignee of certain of Maza’s property, was also a defendant below, but it has not filed an appeal. Plaintiff Segovia Development Corporation is only a nominal, disinterested party, and has not participated in this appeal.
     
      
      . Since our jurisdiction over this case is predicated on diversity of citizenship, 28 U.S.C. § 1332, local law controls the substantive rights of the parties. Erie R. R. v. Tompkins, 304 U.S. 64, 58 S.Ct. 817, 82 L.Ed. 1188 (1938). The Bankruptcy Act “does not undertake to determine what property belonged to the bankrupt as of the date of bankruptcy * * * ” or the existence, priority or validity of liens on such property. Seymour v. Wildgen, 137 F.2d 160, 161 (10th Cir. 1943). “Questions of that nature are determined by reference to the law of the state.” Id.
      
     
      
      . Defendants’ reliance on Armstrong e Hijos v. Diaz, 95 P.R.R. 800 (1968) and American Surety Co. v. Superior Court, 97 P.R.R. 440 (1969), for a contrary proposition is misplaced. Those cases were decided under Article 1489, 31 L.P. R.A. 4130, which provides that laborers and materialmen who work for a contractor may sue the owner for any amount the owner owes the contractor when the action is brought. American Surety was a suit by a surety as assignee of a subcontractor against the owner and contractor for unpaid labor costs. Diaz was a suit by materialmen against the owner and contractor for unpaid material costs. The District Court in the present case correctly stated that:
      What these cases stand for is first, that materialmen and laborers have a privileged “direct action” [under Article 1489] against the owner of a project for services and materials owed to them by the contractor; second, that this privileged status has its limits; and, third, that it is transferable. They definitely do not hold that there cannot exist any beneficial interest in sums retained by the owner. [Trial Judge’s opinion at 7 (footnotes omitted)]
      
        See also, Inter-American Builders, supra, 98 P.R.R. at 727. While subrogation was not involved in Diaz or American Surety, an assignment, as in American Surety, is sufficiently similar to subrogation so that transfer by means of subrogation would also be valid. See, Trial Judge’s Opinion at 7, n.ll.
     
      
      . While the subrogation provisions partially relied on in Sobrinos are no longer part of the Civil Code, they were substantially the same as those presently in effect. See, e. g. Articles 1738 and 1166, 31 L.P.R.A. §§ 4912, 3250, discussed supra.
      
     
      
      . In so holding, we do not base our decision on any assignment of retainages from Maza to Federal, and therefore any possible ambiguity in the trial judge’s opinion relating to a possible assignment is irrelevant.
     