delivered the opinion of the Court. [After stating the facts.] It would seem on this statement hardly to admit of a doubt, that the trustee held the sum received from Otis in Matanzas, with such deductions as he may equitably charge, as the trustee in equity for Otis, and accountable to him in a court of equity therefor; and according to the generally received notions of the action for money had and received, that it would be one of the most fit applications of it as a remedy, to cause the money of Otis thus in the hands of the trustee, to be paid to its true owner, if it be not intercepted by some creditor ; and it is conceded, that if Otis under these circumstances could recover the money, the respondent must be charged as his trustee in the present action. If it shall turn out, upon examination ot the facts, that the United States have received full satisfaction of the bond in which he was surety, so that he is wholly discharged in law therefrom, certainly the respondent cannot hold this money conscientiously to his own use ; and I should regret that any technical difficulties should enable him to hold what conscience and justice would require him to give up. But difficulties of this kind have been most ingeniously arrayed, in one of the best sustained arguments I remember to have heard, in support of a cause which I think will appear, on examination, to be essentially bad. One of the grounds, and I believe that which is thought to be the strongest, is, that the money was received by the respondent under such circumstances as would disable Otis from reclaiming it in any action, were he the plaintiff. This is a ground of defence which I am persuaded the respondent would not think himself justified in talcing against Otis himself, for no honest man would think of retaining another’s *101money, merely because the law minished no means of compelling him to pay it; but as a creditor of Otis is now claiming it, he may think it not unconscientious to put himself on strict legal points of defence, intending perhaps to pay it to Otis himself at some future time, when he shall be discharged of this suit. At any rate he has a right to stand upon the law, and we must see whether that is so defective in furnishing a remedy, as this ground of objection supposes.
This objection divides itself into two branches ; first, that the payment of the 2000 dollars in Matanzas was voluntary on the part of Otis, upon a claim made with legal process on the bond of indemnity before mentioned, and that being thus paid it cannot be recovered back ; secondly, that the repayment by Mr. Blake of the 1000 dollars paid to him by the respondent on account of Otis’s deficiency, was not to the use of Otis, and that there was no privity of contract, express or implied, which will entitle him to an action for the amount.
In support of the first position it is alleged, that the respondent had a legal demand against Otis on the bond of indemnity, having been damnified to the amount of 1000 dollars, which he had paid to Mr. Blake for the use of the United States on account of the bond in which he was surety. He had no doubt a right of action and could have recovered to the extent of his loss, but he would have been limited to that. When he received 2000 dollars, it must either have been upon a promise, expressed or implied, to apply the surplus to the extinguishment pro tanto of the debt of Otis to the United States, and so to relieve himself from his liability; or as a security in lieu of the bond of indemnity. And in either of these views he would be accountable to Otis, if the purpose for which the money was paid should not have been executed. It cannot be imagined that a man who had fled to. avoid the demand of the United States, would voluntarily give 1000 dollars to a creditor who had pursued him beyond the seas. If he had paid only the sum which the respondent had paid for him, with the expense of pursuing him, this might well be called a voluntary payment, *102and without any subsequent liability the respondent would not be obliged to refund ; but the mere fact of paying double the amount which under any pretence could be claimed as a debt, would afford sufficient presumption to a jury, that the respondent received it as trustee for Otis, or as a pledge or security against future demands upon ■ his bond to the United States.
His counsel, however, suggested that the condition of the bond of indemnity having been broken, he was entitled to the whole 2000 dollars as the penalty, and that as Otis could be relieved from the penalty only by a court of equity, he cannot be answerable as trustee to any of his creditors ; as in order to entitle them to this process they must show a legal debt subsisting from the trustee to the debtor in the suit. I do not think this argument well founded, for in a suit at law upon a bond of indemnity the obligee would recover only his actual damages ; the law providing, that when a breach shall be found, either by confession, or demurrer, or by verdict, the court shall render judgment only for what is due in equity and good conscience. So that on payment of the penalty of the bond he became answerable as trustee for all beyond bis equitable demands, and upon a final discharge of his liability the obligor would be entitled to recover whatever surplus might be in his hands. If a surety in a bond for the faithful conduct of a cashier or other officer of a bank, should require a pledge of stock or other property from the principal, as a source of indemnity in case he should be damnified by any act of his principal, and the principal should resign or otherwise vacate his office, no official act having occurred to render the surety liable, can it be pretended he can hold the pledge to his own use, or that the laws do not furnish means to the principal to restore himself to his rights ? And there is no difference between the payment of money and the giving a pledge under such circumstances, if the payment were made to enable the surety to indemnify himself, and it appear afterwards that he has suffered and can suffer no damage. Now we think, that when the respondent received the 2000 dollars in Man tanzas and gave up the indemnifying bond, he took all beyond the sum *103he had paid to Mr. Blake, as a security against his future payments, instead of the bond, and that if he is discharged from his suretiship, either by law or by the act of the creditor, the money in his hands becomes the property of the principal, and that the law implies a promise to repay it. This is not founding an implied promise upon a mere moral obligation, but the promise grew out of and accompanied the original receipt of the money. It was the principal’s money, to be applied to a particular use, and not being so applied, if the liability of the surety has ceased, his lien upon it has ceased, and he is bound upon principles of justice, as well as by law, to repay it.1
The case therefore is not like a voluntary payment of money claimed as a debt, and therefore is not affected by any of the numerous decisions which have been cited. The respondent, in his answers, has not pretended that he claimed this 2000 dollars as a debt, and if he had, the circumstances under which it was paid would show a coercion and extortion on his part, which of itself might perhaps be a sufficient ground of action ; for it was not paid under legal process, in the sense of most of the authorities cited, there being in those cases a trial and judgment, and the decision being, that where a man has an opportunity to defend himself against a demand, and does not do it, but submits, or if he defends himself, is cast, he shall not, in another action for the money, call into question the merits of the former judgment. Such was the case of Marriott v. Hampton, 7 T. R. 269; of Grant v. Button, 14 Johns. R. 377 ; of Homes v. Aery, 12 Mass. R. 135 ; and of Homer v. Fish, 1 Pick. 435. We do not find that this principle has been applied to a case like the present, where a man has been arrested in a foreign country, and to avoid personal suffering, or great injury to his property, when unable to find bail or give satisfactory security, has pa'd double the sum which could be justly claimed of him; but whether such a case would be considered as an exception to the general rule or not, there is no occasion now to decide, because, for the *104reasons before stated, this payment must be considered to have been made on a mutual understanding that it should be accounted for.
Several of the other cases cited have still less analogy to the case before us, establishing the well known and just doctrine, that when money is paid upon an illegal bargain or contract, which the party receiving cannot be compelled to execute, it shall nevertheless not be recovered; in conformity with the maxim, in pari delicto, potior est conditio defendentis. This is the doctrine laid down in Lowry v. Bourdieu, Doug. 468, and many other cases in English and American books.
A third class of the cases cited is equally remote from the case before us ; they decide, that the consideration paid for the purchase of land, which is conveyed by deed, cannot be recovered back in an action for money had and received, although the title fail in the hands of the purchaser, and this because there are either covenants upon which the party may have a remedy, or if there be not, the absence of them is evidence that the purchaser took the title at his own risk. Such are the cases of Howes v. Barker, 3 Johns. R. 506 ; of Gates v. Winslow, 1 Mass. R. 65 ; of Wallis v. Wallis, 4 Mass. R. 136.1
There remain two or three cases cited by the respondent’s counsel, which do not come within either of the above classes, but which do not however maintain the position he contends for.
The case of Oddy v. Bovill, 2 East, 479, only decides, that the sentence of a foreign court of peculiar jurisdiction is *105conclusive upon the rights of parties who have been regularly subject to that jurisdiction.
The case of Hall v. Shultz, 4 Johns. R. 240, is the strongest in favor of the respondent. There one who had purchased land of a debtor sold on execution, under an engagement to convey it to the debtor on payment of the purchase money, expenses, and a reasonable compensation for trouble, refused to perform his agreement unless the debtor should pay him 300 dollars for his trouble, which was thought an unreasonable sum, and the plaintiff, in order to obtain his title, paid this sum, protesting against the demand as unjust, received his conveyance, and then brought his action to recover this money back. Spencer J., who delivered the opinion of the court, thought there was no moral obligation on the part of the defendant to reconvey the land; that it was a resale, and that he might lawfully insist on his own terms ; and that the payment of the 300 dollars was purely voluntary ; and also thought it came within the statute of frauds. Thompson J. dissented, and supported his opinion by a very able argument. Here was no restraint of the person, and there was a right to demand something. Whether 300 dollars was too much or too little, was a matter which the parties might well settle between themselves, and in this respect, as well as others, the case differs toto ccelo from the case before us ; w’hich is where there was an ascertained demand of 1000 dollars, and the respondent received 2000, which he could not have done, except by a fraudulent representation of the amount paid by him, or as security for what he might afterwards be called upon to pay ; and as the latter was consistent with honesty, we are inclined to believe this was the ground on which he received the money. There is nothing therefore in any of the cases cited, to prevent us from adopting the fair and just conclusion, that when the 2000 dollars was paid, one half was intended by the parties to be applied to the payment of what had been advanced by the respondent, and the other half was to be held by him to respond future claims; and this carries with it a promise to restore the money, if no such claims should be made. And I think also it involves a promise to hold the whole money in *106trust for the same purposes, in case it should turn out that the respondent had paid nothing, or what is the same thing in substance, if what he may have paid should be restored to him ; which is a sufficient answer to the other objection, that there was no privity of contract by which Otis could recover the 1000 dollars repaid by Mr. Blake to the respondent. The very receiving back of that money worked a restoration m law of the right to the 2000 dollars received by the respondent at Matanzas, subject to his lien to secure himself against future calls upon him as surety. The merits of the case therefore in a legal, as well as an equitable view, are decidedly and clearly against the respondent.
I will then consider the question, whether there is now any legal liability on the respondent, by virtue of his suretiship for Otis, which could justify him in a future retention of the money. By the papers annexed to the answers, and which make part of them, it appears that a suit has been commenced by the United States against Otis, on the very bond on which the respondent was surety, and that judgment has been recovered and satisfied by a levy on land, and the execution returned fully satisfied ; and further, that the land so taken, after the right of redemption had passed, has been sold by the United States, and the proceeds received into the treasury, and that the purchaser has no legal claim by warranty or otherwise, in case his title derived from the government shall fail. Here certainly is a complete and perfect extinguishment of all liability on that bond by the sureties ; if they should ever be sued on it, these proceedings vvill be a perpetual bar to any action.
But it is said that the title of the United States may possibly fail, and that one Warren has threatened to set up his title to defeat that which was acquired under the levy ; and that this apprehension is a sufficient reason for retaining the money belonging to Otis. But this doctrine cannot be maintained. It is enough for. Otis to show that legal satisfaction of the debt due on that bond has been rendered, to entitle him to draw from his surety moneys deposited with him as security. If this justification is good at all, it will remain good until the purchaser under the United States has been *107in possession, undisturbed, forty yeai 3; and nothing can be more unreasonable than to set up a pretence of the kind. Besides, suppose the land could at some future time be recovered by Warren or his heirs ; the purchaser can have no legal nor even an equitable claim for damages against the United States.1 He purchased the title at a risk, and paid for it in proportion, having given less by 700 dollars than it was appraised at. The government might possibly, in mercy, repay him the consideration, but if they should, it would be a mere voluntary payment, which, upon the very doctrine contended for, would give them no right to resort to the sureties, and probably not even to the principal, for a new satisfaction of the judgment. It would be enough to show in a court of equity or law, that there being evidence by record of a satisfaction of the debt for which he was surety, he had surrendered the pledge to his principal which he had taken to indemnify himself, and this fact would forever exonerate him from any claim.
There remains another point in this fruitful case, which appears to us as untenable as the others. It appears that the United States have sued Otis in an action now pending, for some debt not covered by the bond to which the respondent was a party ; that he is summoned in that suit, as the trustee of Otis, on account of the money which he is sued for in this action. That suit was commenced after the present one, but it is contended, that by virtue of the statutes of the United States, a priority is secured to them in certain cases of which this is one. Happily, this question has been settled by the courts of the United States themselves. The United States have priority in cases of insolvency, such as they themselves in their statutes have defined and described. They are three; bankruptcy, a voluntary assignment of property to pay all the debts of the insolvent, and when the estate and effects of an absconding, concealed or absent debtor shall be attached by process of law. This is enacted in U. S. Laws, 4 Cong. 2 Sess. c. 74, and the *108subsequent statutes on the same subject do not enlarge this priority.
In the case of Bartlett v. Prince, 9 Mass. R. 431, it was attempted to enforce this priority in behalf of the United States, in a case where an attachment was made upon the goods of persons who had failed ; but the Court held that no priority for the United States existed ; and this opinion was confirmed and sanctioned in the Supreme Court of the United States, in the same case carried there by writ of error. 8 Cranch, 431.
But it is insisted that this process, by which the respondent is now held to answer, comes within one of the definí tions of insolvency established by the statute of the United States, viz. that it is the case of “ the estate and effects ot an absconding, concealed or absent debtor, attached by process of law.” It is a sufficient answer to this, that our statute, which establishes the trustee process, does not require as a preliminary to the execution of it, that the debtor, whose goods or effects are attached, should have absconded, concealed himself, or should be absent, but that its princi pal office is to attach credits or effects which cannot be at tached by the ordinary process of law ; so that to make this a ground of priority for the United States, would be attended with the same consequences, as if the priority should be applied to an ordinary attachment, and thus the case of Bartlett v. Prince would be overruled. It is proper that this high prerogative right of the United States should be construed strictly, as it is in derogation of the rights of crediors ; and the Supreme Court of the United States have discovered a due regard to this principle in their decisions. A government which has the power to take, should never be allowed more than by express terms it demands ; for the doctrine of implication here might swallow up all individual rights. In the case in 8 Cranch, 431, the court say, “ Insolvency must be understood to mean a legal and known insolvency manifested by some notorious act of the debtor pursuant to law.” And in United States v. Hooe, 3 Cranch, 91, it was decided, that to give the priority in a case of voluntary assignment, it must be an assignment of all the prop*109erty of the debtor for the use of the creditors ; a sort of substitute for a commission of bankruptcy. And the same doctrine is held in the case, M'cLean v. Rankin, 3 Johns. R. 370.1
The inference from these cases, in which the statute of the United States giving priorities has been construed, is, that it was intended to operate only where by law, or by the act of the debtor, his property was sequestered for the use of his creditors, and not where there may be a mere insolvency, or an individual attachment of the goods or effects of the debtor.2 To give it effect in the latter case would be, as Chief Justice .Marshall says in the case of United States v. Hooe, to establish a lien in favor of the United States on the estate of their debtors, which was not intended. The effect of attaching the goods and effects of an absconding, concealed or absent debtor, being in some of the States, certainly in New York, to cause a distribution among all the creditors, the statute of the United States, which makes this a ground of priority, must be construed to apply to such attachments, and not to those which have no other effect than an ordinary attachment, except as to the subject on which they operate.
There is no evidence from the answers, of an assignment of this demand to the United States before the present plaintiff attached. So that all the points are against the respondent, and he must be declared trustee.3
See Watkins v. Hewlett, 1 Brod. & Bingh. 1.
In South Carolina a purchaser of an estate without warranty, on an eviction through failure of title, was permitted in equity to recover back the purchase money. Tucker v. Gordon, 4 Desaus. 53. It was, however, suggested in this case, that the grantor knew that there was a doubt concerning the validity of the title and did not disclose it. This intimation of fraud would bring the case within the reason of Fenton v. Brown, 14 Ves. 144 ; Edwards v. M'Leary, Cooper’s Eq. Rep. 308. See also Abbott v. Allen, 2 Johns. Ch.R. 519; 2 Kent’s Com. 471, 472 ; Lefevre v. Boyle, 3 Barn. & Adol. 877 ; Bordeaux v. Cave, 1 Bailey, 250 ; Westbrook v. M'Millan, 1 Bailey, 259.
See Tucker v. Gordon, 4 Desaus. 53.
See Conard v. Atlantic Ins. Co., 1 Peters, 386 ; Field v. United States, 9 Peters, 182 ; United States v. Hack, 8 Peters, 271. The same right of priority, which belongs to the United States, attaches to the claim of an individual, who, as surety, has paid money to the United States. Hunter v. United States, 5 Peters, 172.
See Cabot v. Haskins, 3 Pick. 83.
Where the plaintiff, who knew or might have known all the facts, paid money under a mistake respecting his liability, it was held, that he could not sustain an action to recover it back. Parsons v. Gloucester Bank, 10 Pick. 533; Hamlet v. Richardson, 9 Bingh. 644 ; Lee v. Stuart, 2 Leigh. 76. But money paid by mistake, through ignorance of the laws of another State of the United States, may be recovered back. Haven v. Foster, 9 Pick. 112. See Raynham v. Canton, 3 Pick. 293 ; Griggs v. Austin, 3 Pick. 20 ; Fisher v. Ellis, ibid. 322 ; Cowling v. Beachum, 7 J. B. Moore, 465 ; Weston v. Hudson, 3 Rawle, 390.