A judgment was obtained in the above-entitled action for the foreclosure of a mortgage and the sale of mortgaged premises. Upon the sale there arose a surplus of $4,474.31. The petitioner Benjamin M. Baker, one of the defendants in the action, claimed the surplus money as a junior mortgagee, and petitioned the court for an order directing said surplus money to be paid to him. His application was opposed by the defendants William O. C. Wood and Johanna S. Wood on the ground that there was a prior action pending in the supreme court, in which action the right of the claimant to the moneys was being contested, and that a full accounting could be had and a complete adjudication made in regard to the surplus moneys in that action. It appeared upon the hearing of the motion that one Herman Wood, deceased, was in his lifetime the owner of the mortgaged premises, and that in the year 1871 he executed and delivered to the petitioner an instrument in writing, which was in form a deed, but which was in fact intended as a security for money loaned. An action was commenced in the supreme court by said Wood against Baker, seeking to have said deed declared a mortgage; and an interlocutory judgment to that effect was obtained. A referee was appointed by said judgment to take an accounting, and inquire and ascertain what, if anything, was due Baker as such mortgagee. After the entry of said judgment, and on or about the 2d day of August, 1891, the plaintiff Wood died. The action has never been revived, and has since remained in a condition where no accounting could be had therein; and this is the judgment which it is claimed is a bar to this proceeding.
Where two proceedings are pending between the same parties for the same object, the one first commenced is, as a general rule, a bar to the second proceeding; but we are inclined to the opinion that this proceeding is an exception to that rule. These surplus moneys have arisen out of an action for the foreclosure of a mortgage in which Francis A. Baker was plaintiff and the petitioner Benjamin M. Baker and others were defendants. The moneys have been paid into court in this action, as required by section 1633 of the Code, and they are now under the control and jurisdiction of the court in the foreclosure action; and it is fitting and proper for the court in that action to distribute the same by this proceeding, which is an incidental or interlocutory reference, under section 1015 of the Code. Upon the hearing before the referee all parties to the action, or any person who had a lien on the mortgaged premises at the time of the sale, and who has filed proper notice, is entitled to notice thereof and can appear and be heard. The powers of the referee are very broad in such a proceeding. He can hear any evidence which may be offered affecting the judgment or lien upon which the claim to the surplus is founded. He can take evidence, or investigate any legal or equitable question pertaining to the issue, the same as could be done in an independent or original action. He is required to find facts and conclusions of law. The parties to this action are not the same as they were in the action of Wood *1085against Baker. The action sought to be used in bar of these proceedings, as we have seen, abated by the death of the plaintiff. It has not been since revived, and from the facts appearing upon the hearing of the motion it is altogether probable that nothing will ever be done looking to its revival. The order appealed from was properly granted, and it should be affirmed, with $10 costs and disbursements of the appeal. All concur.