The plaintiff, White Plains Sash & Door Co., Inc., the defendant Reagan & Ottaviano, Inc., and the defendant Walter A. Phillips sold and delivered building materials to the defendants John and Mary Doyle for the improvement of real estate owned by them. All the materials so furnished were delivered upon the premises prior to June 5, 1929. During that month each of the persons who thus supplied materials duly filed notices of mecharic’s liens against the premises to protect their claims. On July 26, 1929, the defendant owners, as principals, and the defendant Detroit Fidelity 'and Surety Company, as surety, executed undertakings, in respect to each of the three liens, each undertaking being “ conditioned for the payment of any judgment which may be rendered against the property for the enforcement of the lien.” On the filing of these undertakings, the court, acting in compliance with the provisions of section 19 of the Lien Law (Cons. Laws, ch. 33), made appropriate orders discharging the three liens. Subsequently, on November 29, 1929, this action was brought to foreclose the plaintiff’s lien, and the two other lienors, who were made parties defendant, demanded that their liens likewise be foreclosed. On December 17, 1929, a notice of pendency of this action was filed. Two years elapsed before the action was tried. Meanwhile, no further act was performed by any of the lienors to continue their liens. *19It is claimed by the defendant, the surety company, that, through this neglect, the liens expired, and that it was relieved from the obligations assumed by its undertakings.
It is provided in section 17 of the Lien Law that no lien “ shall be a lien for a longer period than one year after the notice of lien has been filed.” One exception for which the section makes provision is that the general rule shall not apply if, within a year, “ an action is commenced to foreclose the hen, and a notice of the pendency of such action ” is filed. In this instance the plaintiff made literal compliance with the terms of the section. Nevertheless, says the appellant, the filing of the notice of lis pendens was not a true compliance, for the fifing of that notice was ineffective, since the section provides that where “ a fien is discharged by deposit or by order, a notice of pendency of action shah not be filed.” Another exception is provided for by the section. If “ an order be granted within one year from the filing of such notice [of hen] by a court of record or a judge or justice thereof, continuing such hen,” the hen may be redocketed and will continue for one year after the date of the granting of the order. The section also provides that the filing of a lis pendens in an action to foreclose, by either the plaintiff or the defendant, shall operate to continue ah hens sought to be foreclosed in the action.
The very end to be achieved by the filing of undertakings, conditioned upon the payment of the hens found to be outstanding, is to reheve the real estate from incumbrances, so that the same may freely be ahenated by the owner. The order, which follows the filing of each undertaking, is an order “ discharging the hen,” as provided by the very terms of the statute. Any action brought, whether before or after the filing of the undertaking, although a suit ostensibly to foreclose the hen, in reality is, or becomes, an action to test the validity of the hen, had it not been discharged, and, if found vahd, to procure a judgment upon the undertaking, rather than *20a judgment of foreclosure against the real estate. “ The bond, as we have seen, is given to discharge the lien. It is one of the proceedings provided for by the statute, and it was evidently intended 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.” (Morton v. Tucker, 145 N. Y. 244, 248, 249.) Of the deposit of money, under subdivision 4 of section 21 of the Lien Law, to discharge a lien, it has been said: “ In such case the sum deposited is a substitute for the fund to which the hen attached until the deposit was made. A valid hen on the primary fund must, therefore, be established to justify payment out of the deposit.” (Milliken Bros., Inc., v. City of New York, 201 N. Y. 65, 74.) It would seem anomalous that when a hen Upon real estate has been discharged, and a cause of action upon a bond substituted, it should thereafter be necessary to give notice of the discharged hen, by filing a lis pendens, or that an order “ continuing ” a discharged hen must be made, in order that an action upon the bond might be continued after the lapse of one year from the filing of the original lien. For this reason we should be inclined to hold that the provisions of section 17 did not apply to cases where undertakings had been given to discharge the liens. This we may not do, however, because section 17 expressly provides: “ The provisions of this section in regard to continuing liens shall apply to hens discharged by deposit or by order on the filing of an undertaking.” In respect to such liens, however, there is a manifest inconsistency in the section. A lien will be continued beyond one year if within that time “ an action is commenced to foreclose the hen, and a notice of the pendency -of such action ” be filed; yet where “ a lien is discharged by deposit or by order, a notice of pendency of action shall not be filed.” We think that since the Legislature con*21ditioned the continuance of the hen upon the performance of two acts, one of which, by its express command, was forbidden to be done, necessarily continuance of the' hen must follow, if the one act permitted to be done is performed. Therefore, we hold that the bringing of the action to foreclose is sufficient in itself to continue the hen, so far as that may be necessary for the continued prosecution of the action against those signing the undertaking.
The judgment should be affirmed, with costs.
Pound, Ch. J., Crane, Lehman, O’Brien and Crouch, JJ., concur; Hubbs, J., not sitting;
Judgment affirmed.