ANDERSON, Circuit Judge:
Certified Industries, Inc., takes this appeal from an order of the District Court for the Southern District of New York granting the application of the United States for a preliminary injunction which enjoined Certified from proceeding with its action in the New York State Supreme Court to foreclose a lien pending a final determination of the present action brought by the United States.
On September 10, 1962, Carol Management Corporation engaged Meteor Concrete Corporation to supply labor, materials and equipment for the improvement of certain real property at 70 Park Avenue in New York City. The contract price was $80,000. Meteor, in turn, contracted with Certified for the concrete necessary for the making of the improvements at an agreed price of $11,940.69.
After Meteor had been paid $72,981 and had only partially performed, it defaulted on the principal contract. Carol, or its successors, then completed the contract at a cost of $3,541.41, leaving a balance of $3,477.49 due to Meteor. Certified claims that the sub-contract for the concrete was fully performed but that Meteor failed to pay the balance of $3,-025.69 due on the contract price. The present action stems from the claim of the United States that Meteor did not remit withholding, social security and unemployment compensation taxes due and owing to the United States based upon work attributable to Meteor’s contract with Carol. The amount of the tax claim is $3,891.01.
On July 15, 1963, Certified caused a mechanic’s lien to be filed and gave the required statutory notice, pursuant to the New York Lien Law, McKinney’s Consol.Laws, c. 33, on the 70 Park Avenue property to the extent of its unpaid claim against Meteor. An action to foreclose that lien was commenced in the Supreme Court of New York on June 11, 1964. Pursuant to § 19 of the New York Lien Law, Doral Park Avenue Hotel Corporation, Carol’s successor, filed with the clerk of the state court an undertaking of Continental Casualty Company that it would pay any judgment recovered in an action to foreclose the mechanic’s lien. In accordance with subdivision (4) of § 19, the lien was discharged upon the filing of the bond.
The present action was brought in the Southern District of New York by the United States on June 30, 1965. The United States does not assert a tax lien in this action, but proceeds on the theory that it is entitled to have a trust imposed on the funds owed to Meteor by Carol under the “trust fund” provisions of Artiele 3-A of the New York Lien Law. This action is the only one in which all of the possible known claimants are parties, although it would appear from the record that the United States had knowledge of the state court proceedings and considered the possibility of attempting to intervene therein.
Certified moved for summary judgment m the state court foreclosure action in the early part of September, 1965. On September 15, 1965, the United States applied for an order of the United States District Court asking Certified to show cause why a preliminary injunction, barring Certified from proceeding with its foreclosure action and its motion therein for summary judgment, should not issue pursuant to Rule 65 of the Federal Rules of Civil Procedure. The application for a preliminary injunction was granted on October 5, 1965 and Certified appeals from that order. 28 U.S.C. § 1292(a)(1).
The appeal raises a difficult question with regard to federal-state relations. We begin with the premise that the anti-injunction statute, 28 U.S.C. § 2283, which prohibits a federal court from granting “an injunction to stay proceedings in a State court except as expressly authorized by Act of Congress, or where necessary in aid of its jurisdiction, or to protect or effectuate its judgments,” does not apply where the United States, as a party in interest, seeks such a stay. Leiter Minerals, Inc. v. United States, 352 U.S. 220, 226, 77 S.Ct. 287, 1 L.Ed.2d 267 (1957). That decision does not mean, however, that a stay is automatically granted simply on the application of the United States. After enunciating the principle above stated, the Supreme Court went on to say that it was also necessary to inquire “whether the granting of an injunction was proper in the circumstances of this case.” Leiter Minerals, Inc. v. United States, supra, at 226, 77 S.Ct. at 291.
The United States is not entitled to an injunction staying state court proceedings where the state court is the first court to assume jurisdiction over the subject matter property of an action in rem or quasi in rem. United States v. Bank of New York & Trust Co., 296 U.S. 463, 477, 56 S.Ct. 343, 80 L.Ed. 331 (1936); Penn General Casualty Co. v. Com. of Pennsylvania, 294 U.S. 189, 195, 55 S.Ct. 386, 79 L.Ed. 850 (1935). On the other hand, the mere fact that certain property in possession or custody of the state court is indirectly related to the action in the federal court is not a bar to the exercise of federal jurisdiction “where the final judgment does not undertake to interfere with the state court’s possession save to the extent that the state court is bound by the judgment to recognize the right adjudicated by the federal court.” Markham v. Allen, 326 U.S. 490, 494, 66 S.Ct. 296, 298, 90 L.Ed. 256 (1946). In that case, the Supreme Court held that it was proper to exercise jurisdiction where the Alien Property Custodian sought a judgment ordering the executor of an estate being administered in California to pay over the net estate.
The principle applied in Markham v. Allen, supra, is derived from a line of cases which hold that the exercise of jurisdiction over property by one court does not prevent other courts from rendering “any judgment not in conflict with that court’s authority to decide questions within its jurisdiction and to make effective such decisions by its control of the property.” United States v. Klein, 303 U.S. 276, 281, 58 S.Ct. 536, 538, 82 L.Ed. 840 (1938). The actions “to adjudicate rights” of which the Court speaks in Markham v. Allen, supra, are not in rem actions, but those in which the “judgments therein do not deal with the property and order distribution; they adjudicate questions which precede distribution.” Commonwealth Trust Co. of Pittsburgh v. Bradford, 297 U.S. 613, 619, 56 S.Ct. 600, 602, 80 L.Ed. 920 (1936).
There can be little doubt that the initial foreclosure proceeding in the state court was a proceeding in rem, Quimby v. Sloan, 2 E.D.Smith 594, 607, 2 Abb. Pr. 93 (Ct.Common Pleas, 1855), an action in which Certified sought to enforce “an interest in the property improved.” Rapid Fireproof Door Co. v. Largo Corp., 243 N.Y. 482, 486, 154 N.E. 531, 534 (1926). Thus, the present Lien Law provides that the mechanic’s lien is- “upon the real property improved” and that an action to foreclose the lien is governed by “[t]he provisions of the real property actions and proceedings law relating to actions for the foreclosure of a mortgage upon real property.” It is, therefore, quite clear that if the bond of Continental Casualty had not been substituted for Certified’s mechanic’s lien in the state proceedings, the federal court would have been powerless to interfere with the state proceedings. United States v. Bank of New York & Trust Co., supra; Penn General Casualty Co. v. Com. of Pennsylvania, supra.
We are, therefore, presented with the question of whether, in the light of the decisions discussed above, the substitution of the bond for the mechanic’s lien so altered the character of the state lien foreclosure proceeding that it could be stayed by a federal court. We think that it did not.
After the discharge of a lien by the substitution of a bond, the action continues in form as a foreclosure proceeding for purposes of establishing the validity of the lien. Berger Mfg. Co. v. City of New York, 206 N.Y. 24, 30, 99 N.E. 153 (1912); Hall v. Carl G. Ek & Son Constr. Co., 17 A.D.2d 558, 236 N.Y. S.2d 555, 558-559 (4th Dept., 1963), aff’d, 13 N.Y.2d 825, 242 N.Y.S.2d 352, 192 N.E.2d 227 (1963). In effect, the filing of the undertaking with the clerk merely shifts the lien from the real property to the bond, thereby enabling the owner of the realty to free his property from the incumbrance of the lien. It is clear, however, that the right to recover on the undertaking is not personal. Milliken Bros., Inc. v. City of New York, 201 N.Y. 65, 74, 94 N.E. 196 (1911). The action remains in equity and, although the surety may be joined as a defendant for convenience sake, the plaintiff may continue his action after substitution of the bond without making the surety a party though any judgment therein will be conclusive upon the surety. Harley v. Plant, 210 N.Y. 405, 409-410,104 N.E. 946 (1914).
In Morton v. Tucker, 145 N.Y. 244, 249, 40 N.E. 3, 4 (1895), the New York Court of Appeals declared that “the bond should take the place of the property, and become the subject of the lien, in the same form and manner as is provided for in the case of the payment of money into court, or the deposit of securities under an order of the court after action brought.” The alternative ways of posting security discussed in Morton v. Tucker, supra, are provided in Sections 19 and 20 of the Lien Law as statutory procedures by which the owner of property subject to a mechanic’s lien can free his realty from the incumbrance of the lien. Where a county commissioner receives monies pursuant to § 20 of the Lien Law, the money “is considered as paid into court” and “[t]he commissioner holds the fund subject to its orders.” World Steel Products Corp. v. Ogden Gardens, 120 N.Y.S.2d 553, 554 (Sup.Ct. Westchester Co., 1963).
The bond or undertaking “does not change the relation or rights of the parties otherwise than in substituting its obligations for the fund subject to the lien, and it was not within the legislative purpose in permitting the substitution to deteriorate the lienor’s rights.” Harley v. Plant, supra, 210 N.Y. at 410, 104 N.E. at 947. There can be no distinction made in this situation between the effect of a bond and the effect of a deposit as a substitute for the realty as security for Certified’s lien. It is apparent that the New York courts would not make such a distinction. The substitution, whether it be by deposit or bond, does not fundamentally transform the in rem foreclosure action, in which there is a res under the control of the state court, into an in personam proceeding that can be stayed by another court.
The preliminary injunction order of the District Court is not saved by Leiter Minerals, Inc. v. United States, supra. The Supreme Court in that case indicated that where the United States' position is “defensive” it should be able to choose its forum “even though the state litigation has the elements of an action characterized as quasi in rem.” Certified’s assertion of its lien in the state court is not, however, either a direct or an indirect challenge to the right of the United States to retain funds or title to property in its possession at the commencement of the state proceeding. The present case is more akin to United States v. Bank of New York & Trust Co., supra, of which the Supreme Court said “[i]n remitting the United States to the state court, the Court saw no ‘impairment of any rights’ or ‘any sacrifice of its proper dignity as a sovereign.’” Leiter Minerals, Inc. v. United States, supra, 352 U.S. at 227, 77 S.Ct. at 291.
The United States, however, seeks to bring the facts of this case within Leiter Minerals by arguing both that it is only in the federal court where all claimants are parties and that the federal court is the only court in which all of the issues can be tried. The contention is made that under a recent unreported state decision, Charles V. Castaldo Constru. Corp. v. Tinley Management Corp., Civil Court of the City of New York, New York County, Index No. 150639/1963 (1965), the United States would not have been allowed to intervene in Certified’s foreclosure action, and therefore, the federal court is the only court that can supply the requested relief. The Castaldo case is clearly distinguishable. Although the United States presumably attempted to intervene as of right upon a timely motion under New York Civil Practice Law and Rules § 1012, the court in Castaldo concluded that the United States could not invoke Article 3-A in order to collect its tax claim. It might also have chosen, in its discretion, to deny the motion as untimely since it came after judgment. But whatever the right of the United States to intervene in the foreclosure action may have been, it was protected by its right to bring an Article 3-A proceeding in the state court. In any event, we do not reach the merits of the Article 3-A claim of the United States, but conclude only that the right of the United States to intervene for the purpose of asserting such a claim in a foreclosure action has not been conclusively determined by the New York Courts.
As to the second facet of the claim made under Leiter Minerals, it is true that the federal court is now the only court in which all of the issues can be determined since the statute of limitations on an Article 3-A cause of action has expired. The “sovereign dignity” concept does not, however, call for protection of the United States from its own mistake in failing to make its claim by way of intervention in, or the commencement of, a state proceeding where its sole claim for relief is made under a state statute. To hold to the contrary would render meaningless the principles of comity that underlie federal-state relations in the administration of justice 'which the Supreme Court has recognized and considered in each of the injunction cases.
Finally, we find that the principle summarized in Markham v. Allen, supra, is also inapplicable. The United States seeks not merely an adjudication of its rights relative to those of Certified but an injunction which, in barring Certified from proceeding with its motion for summary judgment, directly interferes with and is in conflict with disposition of the fund under control of the state court.
The order of the District Court is reversed.
. Certified had, in turn, sub-contracted with another who, in fact, supplied Meteor with the concrete. Certified's sub-contractor, as the actual supplier, filed the lien and gave the notice; but, on receiving payment from Certified, assigned its claim and lien to Certified, who throughout the present case appeared as assignee.
. Leiter Minerals, Inc. v. United States, supra, 352 U.S. at 228, 77 S.Ct. at 292, indicates that where the position asserted by the United States is defensive, it may he allowed to choose its forum “even though the state litigation has the elements of an action characterized as quasi in rem.” The position of the United States in this action is not, however, a defensive one.
. New York Lien Law, § 3.
. New York Lien Law § 43.
. Raising the technical distinction to a substantive level would not only have an apparently unintended effect on plaintiff’s rights, but would create problems in the administration of justice.
It seems that an owner may first make a deposit and then recover the deposit during the proceedings by substituting a bond. Application of Tumac Realty Corp., 203 Misc. 649, 123 N.Y.S.2d 642 (City Ct. New York, 1952). The rule contended for by the United States would lead to confusion and possible collusion in that situation, i. e., a claimant with priority under Article 3-A might well have enough at stake to make it worthwhile to entice the owner-defendant to make the second substitution so that the late claimant could assert the prior claim in another action after enjoining the first action.
. 352 U.S. at 228, 77 S.Ct. at 292.
. See, e. g., Krenitsky et al. v. Ludlow Motor Co., Inc., 276 App.Div. 511, 96 N.Y.S.2d 102, appeal denied, 277 App.Div. 800, 97 N.Y.S.2d 385, reargument and appeal denied, 277 App.Div. 953, 99 N.Y.S.2d 612 (3d Dept., 1950), appeal dismissed, 301 N.Y. 609, 93 N.E.2d 497 (1950).
. The United States itself indicates in its brief that it has appealed in Castaldo.