Except in the instance provided in sec tion 586 of the Code, a deposit in lieu of bail must be regarded for all the purposes of the action as the property of the party on whose behalf the deposit is made (8 Abb. [N. S.], 155 ; 45 N. Y., 393). Such money, although in custodia legis, may be attached subject to the contingency on which the deposit was made (74 N. Y, 145; 83 N. Y., at p. 237). If the deposit is to be regarded for all purposes as the money of the plaintiff, it follows that the order to pay over was legally made; for, assuming the money belonged to the plaintiff herein, the only persons who could object to the application made of it were the plaintiff and the defendant. The order to pay over having been made on the application of the defendant, concluded him as to its distribution, and it likewise concluded the plaintiff, because it was founded on a legal proceeding against him. It would not ordinarily prejudice the plaintiff’s attorneys on the question of liability for costs, because the order requiring security was made and complied with. So that, but for the question of title in the attorneys, which will next be considered, there can be no doubt of the right of the defendant to do what he did. The contingency on which the deposit was made has happened. The plaintiff recovered a judgment, and by force of it the plaintiff became entitled to the return of his deposit. The deposit has answered all the purposes for which it was made, and the requirements of the law have been fully satisfied. But the difficulty which arises is that the money deposited up till the time of the deposit belonged to the plaintiff’s attorneys. For the purpose of securing the defendant against the costs of the present action, the money deposited was to be deemed the property of the plaintiff. But when it was demonstrated by the result of the action that the defendant was not entitled to costs, and no longer needed the required indemnity, the deposit ceased to be security, and the plaintiff’s attorneys, as the true owners *50of the fund, became entitled to a return of their money. In other words, it seems to me that an attorney for a plaintiff may consent to deposit his own money as security for costs to which his client may become liable in a particular action, with the risk that if the plaintiff therein is defeated the money for the purpose of satisfying the costs recovered by the defendant is to be regarded as the property of the plaintiff. I think he risks no more. The law is satisfied with this construction of the liability assumed, and the defendant proceeded against by the non-resident plaintiff is fully protected by it. If this be so, the result would seem to follow, that after it has been judicially determined that the defendant cannot by any possibility recover costs in the action, that the money should go back to the source from which it emanated, and to the parties to whom it equitably belongs. The identity of the money was not destroyed, but preserved. The identical money which the plaintiff’s attorneys deposited remained in the hands of the clerk until he was ordered to pay it over. There is no proof that it was loaned to the plaintiff, or was ever in his possession. It was deposited by the plaintiff’s attorneys for a special purpose and at a specified risk, and when the object of the deposit was satisfied, and the risk ceased, their ■right to its return became complete. The plaintiff does not question their right to it. The deposit was made in lieu of an undertaking, and subject only to the risk which sureties upon an undertaking would have assumed if an undertaking had been given. Because money was deposited in lieu of an undertaking there is no reason why friendly depositors, who furnished the money instead of writings, should be subjected to greater risk, or liability to loss, than if they had subscribed the usual undertaking with which the law is satisfied. Under the circumstances the conclusion seems inevitable that the deposit must be restored to the clerk of the court, there to remain subject to such application as may be made in respect thereto, as the parties interested therein may be advised.
Ho costs.