The plaintiff filed a notice of mechanic’s lien against certain real estate belonging to the defendant Wilson, which was discharged before the commencement of this action by the giving of a bond or undertaking in accordance with subdivision 4 of section 18 of the Lien Law (Laws of 1897, chap. 418), upon which bond the appellant was surety. Subsequently the plaintiff brought this action to foreclose the lien, joining all persons interested as parties and demanding judgment that the lien be declared valid and the surety liable for the amount found due.
The bonding company demurred to the complaint upon the ground that it did not state facts sufficient to constitute a cause of action, in that the giving of the bond was not sufficiently alleged, and that the complaint failed to state that leave to bring an action upon the bond had been obtained as required by section 814 of the Code of Civil Procedure. The demurrer was overruled and it appeals from the interlocutory judgment.
I am of the opinion that the demurrer was properly overruled. The allegations of the complaint as to the giving of the bond are sufficiently set forth. Nor was it necessary for the plaintiff to obtain leave of the court to bring an action against the surety before joining it as a defendant. It is true, as contended by the appellant, that section 814 of the Code of Civil Procedure provides that where a bond or undertaking has been given, as prescribed by law, in the course of an action or a special proceeding, to the People or to a public' officer, for the benefit of a party or other person interested, and provision is not specially made by law for the prosecution thereof, the party or other person so interested may maintain an action for a breach of the condition of the bond upon procuring an order granting leave so to do. But this section has no application to a bond given for the purpose of discharging a mechanic’s lien under the statute above referred to. The condition of such bond is *664“for the payment of any judgment which may be rendered against the property for the enforcement of the lien,” and this clearly contemplates that an action may be maintained against the surety on the bond, without further application to the court.
Where a mechanic’s lien has been discharged by the giving of a bond the'lienor may do either one of two things. He may bring an action to foreclose the lien against the debtor alone, and if he recovers a judgment establishing the validity of the lien and its amount, then maintain an action against the surety on the bond (Ringle v. Matthiessen, 10 App. Div. 274; affd., 158 H.Y. 740); or he may bring an action in equity against the debtor and the surety on the bond and obtain therein a judgment establishing the validity and amount of the lien and a personal judgment against the judgment debtor and the surety on the bond. (Morton v. Tucker, 145 N. Y. 244; Mertz v. Press, 99 App. Div. 443; affd., 184 N. Y. 530; McDonald v. Mayor, etc., of N. Y., 113 App. Div. 625.) The latter, however, would appear to be the better practice and this seems to have been the view of the Court of Appeals in Morton v. Tuclcer (supra). There, that court, after demonstrating that a similar statute (Laws of 1885, chap. 342, § 24, subd. 6) evidently intended that the bond should take the place of the property, said: “If this'is so, the practice is simple. The action is in equity, brought under the statute, in which all of the persons' interested, including the sureties upon the bond, are made parties. The complaint is in the usual form, with the exception that it should allege the giving of the bond and the discharging of the lien, so far as the real estate is concerned, and instead of asking judgment for a sale of the premises, it should demand relief as against the persons executing the bond for the amount that should be determined to be payable upon the lien.”
This action is under the statute, really to enforce the lien of the plaintiff and to recover against the surety upon the bond, because the bond has taken the place of the real estate against which the notice of lien was filed. It is not to recover for a breach of the condition of the bond, such as is contemplated by- the section of the Code above referred to. To hold otherwise would require a lienor, where a bond has been given to discharge the lien, to obtain leave of the court before he could properly bring this action, when but *665for the giving of the bond he would be under no such necessity. The Legislature in providing for the discharge of the lien by the giving of a bond, must have intended to allow the lienor the same remedies against the bond that he would have had against the property if the bond had not been given.
The judgment appealed from, therefore, should be affirméd, with costs, with leave to the appellant to withdraw its demurrer and answer on payment of the costs in this court and in the court below.
Patterson, P. J., Houghton, Scott and Lambert, JJ., concurred.
Judgment affirmed, with costs, witli leave to defendant to withdraw demurrer and to answer on payment of costs in this court and in the court below.