The direction in the judgment of foreclosure that the mortgaged premises be sold “ subject to all local real estate taxes, assessments and water rates, which are or may become liens on the premises at the time of the sale ” is not a proper direction under the circumstances of this case. Under section 1087 of the Civil Practice Act, local real estate taxes, assessments and water rates which are liens upon the property must he paid out of the proceeds of the sale "by the officer making the sale “ unless the judgment otherwise directs This author*160izes the court to direct a sale of mortgaged premises subject to local taxes in an appropriate case but this authority may not properly be exercised in a case such as this in which there is a problem of circular priorities. While the lien of the local taxes is admittedly superior to the lien of the plaintiff’s mortgage, the appellant United States contends that the lien of the local taxes is inferior to the Federal tax lien by reason of the fact that the Federal tax lien was filed prior to the accrual of the local taxes, but it concedes that the Federal tax lien is, in turn, inferior to the mortgage lien, having been filed after the mortgage was recorded. To direct that the property be sold subject to the lien of local taxes in this situation is, in effect, to give the lien of the local taxes a super-priority, in disregard of the fact that the Hen of the local taxes is claimed to be inferior to the Federal tax lien. The amount reafized upon the sale would undoubtedly reflect the fact that the property had been sold subject to the lien of the local taxes and the proceeds of the sale available for the payment of all other liens, including the Federal tax Hen, would be accordingly reduced.
We therefore reverse the direction to seH the property subject to local taxes and we also reverse the provision of the judgment striking out the answer of the appellant and we remit the ease to the County Court for the entry of a new appropriate judgment which recognizes the respective priorities claimed.
The appellant requests that the problem of the circular priorities be solved by providing in the judgment that, out of the net proceeds of sale, i.e., the funds remaining after payment of the expenses of sale (not including local taxes) and the plaintiff’s costs, there be set aside a sum equivalent to the total of the amount owing on the plaintiff’s mortgage and the amount of any other liens superior to the Federal tax Hen; that thereafter the Federal tax Hen be paid and then the local taxes be paid and that, if there is not enough left to pay the local taxes in full, the balance owing on the local taxes be paid out of the sum originaHy set aside and that only the balance then remaining of that sum be paid over to the plaintiff and the other lienors for whose benefit the sum had been set aside. This request is made upon the authority of United States v. New Britain (347 U. S. 81). (See, also, Metropolitan Life Ins. Co. v. United States, 9 A D 2d 356; but, see, Rikoon v. Two Boro Dress, 9 A D 2d 783, motion for leave to appeal denied 7 N Y 2d 711.)
However, there is no way of determining in advance of the sale whether the question of priorities sought to be raised by the appellant will ever arise. If the net proceeds of sale are not sufficient to pay the amount owing on the plaintiff’s mortgage *161and on any other liens superior to the Federal tax lien, there will concededly be nothing left to apply on the Federal tax lien and therefore no question will arise as to the effect to be given to the superiority of the Federal lien over the lien of local taxes. Similarly, if the net proceeds of sale are sufficient to pay all liens, including both the Federal tax lien and the local taxes in full, no question of priorities will arise. It is only in the event that net proceeds are in excess of the amount owing on the plaintiff’s mortgage and on any other liens superior to the Federal tax lien, but less than the amount needed to pay all liens in full, that the question of the effect to be given to the priority of the Federal tax lien over local taxes will arise.
In this situation, it may well be that the best way to dispose of the matter is to have the premises sold free and clear of all liens, without determining the manner of distribution of the proceeds prior to the sale, leaving the question of priorities to be decided later, if it should become necessary to do so. However, the court cannot authorize the sale of the premises free and clear of all liens, in the manner suggested, unless all the parties holding liens are made parties to the action. The City of Buffalo, the County of Erie and the Buffalo Sewer Authority are not now parties. They should be made parties either by the service of a supplemental summons or by the service upon them of the appellant’s answer with an appropriate summons (treating the so-called affirmative defense in the answer as a counterclaim against the holders of local tax liens; see Civ. Prac. Act, § 271).
The judgment of foreclosure, insofar as appealed from, should therefore be reversed and the case remitted to the County Court for further proceedings.
Present — Williams, P. J., Bastow, Goldman, Halperh and McC'litsky, JJ.
Judgment of foreclosure insofar as appealed from unanimously reversed on the law and in the exercise of discretion and case remitted to the Erie County Court for further proceedings in accordance with the opinion, without costs of this appeal to any party.