*464 By the Court,
Millek, J.The principal question in this case is, what was the effect of the release executed and delivered to Burton on the 6th of May, 1858 ? Did the assignment of the costs to Burton then enure for the benefit. of Higgins, or did they become vested in Oostigan and pass over to Werner, who was on the next day appointed receiver in the supplementary proceedings which had been previously instituted against Oostigan upon the judgment in favor of Cuyler & Henry ? The assignment of the costs by Oostigan to Burton was made to indemnify Burton as second indorser of the two hundred dollar note made by Higgins; and the release to Burton by the owner of the judgment discharged him absolutely and unqualifiedly from all liability arising upon the note; and it could not be collected of Burton subsequent to that time. He therefore, from the time of the release, ceased to have any interest in the moneys, or any control over them. How did the plaintiff stand in relation to the parties ? He was the accommodation maker for the benefit of Oostigan, although it appears that to the extent of seventy-five dollars the note was given for services rendered him by Oostigan, and for which he was indebted to Oostigan. Under these circumstances the question arises, whether the plaintiff was entitled to be subrogated in the place of Burton.
It is a general principle of equity that a surety, or a party who stands in the relation of a surety, is entitled to be subrogated to all the rights and remedies of the creditor against the principal whose debt he was compelled to pay. (Matthews v. Aikin, 1 Comst. 599. Fell’s Law of Guar, and Sur. note 19, p. 296.) And where a person standing in the situation of a surety for the payment of a debt receives a collateral security for such payment for his indemnity, the principal creditor is in equity entitled to the benefit of such collateral security; although he did not originally rely upon the credit of such collateral security, or know of its existence in the first instance. (Curtis v. Tyler, 9 Paige, 435. Bank of *465Auburn v. Throop, 18 John. 505. Moses v. Murgatroyd, 1 John. Ch. 119. Phillips v. Thompson, 2 id. 418. Vail v. Foster, 4 Comst. 312.)
As the plaintiff was actually indebted for a portion of the note to Costigan, he could not have any claim against Costigan to the amount of that indebtedness, as he would only pay his own debt to that extent, by paying the note. It is very questionable, under the authorities cited, whether the plaintiff occupied such a position as to entitle him to the benefit of the rules laid down in reference to the remainder of the note. He was not the principal creditor, as the note belonged to another party; and so far from being the surety of Burton he was his principal. As between himself and Burton, he was bound to pay the whole note, and was in fact and in law primarily liable. It is difficult to see how the principle of subrogation is applicable to such a case, and by what legal rule an accommodation maker of a promissory note, for whose benefit part of the note was given, can claim an equitable right to a security which had been pledged to the person who occupied the position of second indorser, for his special indemnity, after such second indorser has been absolutely discharged from liability. But even if the principle of subrogation could be invoked under such circumstances, the plaintiff was not in a position to claim that right. In order to avail himself of the benefit of this security, it was essential that he should have paid the debt for which he was liable. (Willard’s Eq. Jur. 110. Mathews v. Aikin, 1 Comst. 505. Elwood v. Deifendorf, 5 Barb. 398. Hayes v. Ward, 4 John. Ch. 123.)
This had not been done, and therefore, if otherwise entitled to claim an assignment of the costs in question and to be clothed with the rights of an assignee of such claim, the plaintiff was barred from so doing, and the failure to pay was an insurmountable barrier to the assertion of any such right. The right of subrogation could only accrue upon *466payment by the plaintiff of the full amount of the debt, which,, at the time when Burton was released, had not been done.
Such being the case, and Burton having been unconditionally released from all liability upon the note, the costs which had been pledged to him and in which he only had a special property for the purpose of indemnifying him as indorser, reverted back to, and became the property of, Costigan. (Brownell v. Hawkins, 4 Barb. 491.) From that moment the title was in Oostigan, subject, however, to the rights acquired by virtue of the proceedings supplementary to execution which had been instituted and were pending, and subject to any order which might be made in these proceedings. A receiver having been appointed, by operation of law, the title to the costs became vested in the receiver by force of this appointment. (Porter v. Williams, 5 Seld. 142. West v. Fraser, 5 Sand. 653. Steele v. Sturges, 5 Abb. 442. Levy v. Cavanagh, 2 Bosw. 100. Wilson v. Allen, 6 Barb. 542. Fessenden v. Woods, 3 Bosw. 554.)
The costs then, on the 7th day of May, 1858, belonged to, and became vested in Werner, as receiver of Oostigan, and the subsequent assignment of them by Burton conveyed no title to the plaintiff. Whatever interest Burton ever had, became divested by the release to him as second indorser of the note, and he never afterwards became invested with any inter-' est which he was authorized to assign to any one.
Werner being receiver of Oostigan was duly authorized to receive and collect the costs of the defendant, and a payment by the defendant to Werner or to his attorney exonerated the defendant from liability. If Werner made an improper appropriation of the money, the law would furnish a remedy to compel him to account to the proper person.
The remarks already made leave the money in the hands of an officer of the court where it legitimately belonged, and this would seem to dispose of the case without any further discussion. As, however, it is insisted that the amount of the judgment against the plaintiff and Oostigan was fully *467paid by the receiver of the plaintiff, and therefore to hold that the plaintiff was not .entitled to those costs would in effect compel him to pay the note twice, it may be well enough to examine this proposition.
It seems to be based upon the erroneous idea that the costs were paid over to the assignee of the judgment (who was also the attorney for Werner, the receiver,) as such assignee, and appropriated by him on the judgment; thus making a double payment of it, or a holding by him without an appropriation of them. How I do not understand that this is the fact. The judge has found that the money was paid over to him as the attorney of Werner the receiver of Costigan. It is not claimed that it belonged to the attorney ; nor does the evidence show that he appropriated it to the payment of the judgment, or to his own use. It was merely in his hands, to be paid over to the receiver to be applied by him in payment of the judgment of Cuyler & Henry against Costigan, or to such other purposes as might be lawful. The receiver is accountable for the money, and would be responsible to whoever was entitled to it. If he did not apply the money upon the judgment under which the proceedings were instituted, as he was bound to do, he would be liable to the party authorized to call him to an account. If the attorney failed to pay the receiver, a right of action accrued to the receiver, to compel him to pay over what did not belong to him. It is quite probable that the money was applied upon the judgment of Cuyler & Henry, although the evidence does not distinctly show that fact. It is not important in this case to determine what disposition was made of it, and it is quite enough that it was lawfully paid to the attorney of the receiver, who was vested with power to collect these costs. It is very clear, to my mind, that the plaintiff) in any view which may be taken of the subject, had no equities of any kind in the money in question, at the time of the release to Burton, or any subsequently acquired right to the same. If he had any claim, *468his remedy was against the receiver, and not against the defendant, whose responsibility ceased, when he paid over the money to the attorney of the receiver; and he cannot therefore sustain this action.
Albany General Term, December 5, 1864.The money being voluntarily paid by the referee to the receiver, of course no action was necessary by him to test the question as to whom the money belonged to. In fact it does not distinctly appear that the plaintiff claimed it of the referee, or that any contesting claims were presented to him.
I am also inclined to think that there is another insuperable obstacle to a recovery in this action. The defendant being a referee appointed by the court to perform certain duties, was one of its officers, and the moneys in his hands being in the custody of the court, no action could therefore be brought against him without the permission of the court. Either leave must be obtained or an application should be made by motion for directions as to the disposition of the funds. This doctrine has been repeatedly held as to receivers, and by analogy there is no good reason why it should not apply to referees, who would seem to stand upon the same footing. (Willard’s Eq. Jur. 335, 336. De Groot v. Jay, 30 Barb. 483. Musgrove v. Nash, 3 Edw. 172. Parker v. Browning, 8 Paige, 388. Noe v. Gibson, 7 id. 513. Vincent v. Parker, Id. 65. Taylor v. Baldwin, 14 Abb. 166.)
It follows, for the reasons given, that the judgment of the circuit court must be affirmed with costs.
Peckham, Miller and Ingalls, Justices.]