This action was brought to recover the sum of $7,599, which the plaintiff alleged he was required to pay as a result of a fraud practiced upon the superior court of Cowlitz county by the defendant Yelton, through her attorney Melvin C. Rooney, who acted in behalf of the marital community composed of himself and his wife, Isobel H. Rooney. After the institution of the suit, the defendant Melvin C. Rooney died, and his executrix, Isobel H. Rooney, was substituted as defendant representing his estate. The defendant Isobel H. Rooney will be referred to herein as the executrix, Melvin C. Rooney as the decedent, and Ina Yelton as the defendant.
According to the findings of fact, which are not questioned on appeal, on January 8, 1947, the defendant obtained a *224judgment against one George Haley and wife in the sum of $8,362.46, with interest and costs. In the superior court of Cowlitz county, she secured a writ of garnishment and served it on the plaintiff, who answered that he was indebted to Haley in the amount of $4,381.50, but that Haley had made an assignment for the benefit of creditors to the Portland Association of Credit Men and Louis Schaefer, an attorney, and the plaintiff was in doubt as to whom payment should be made. He paid into the registry of the court the amount admittedly due. The assignment for the benefit of creditors had figured prominently in the suit brought by the defendant against Haley.
On May 23, 1947, the decedent prepared and filed a motion for judgment on the garnishment. At the instance of the decedent, a judge of the superior court signed and filed an order denominated “Judgment on Answer of Garnishee Defendant.” The order provided that the plaintiff should recover the sum of twenty-five dollars attorney’s fees and should be released from all further liability to George Haley and/or Avis Haley, his wife, or to their assignees. The clerk was directed to pay the remainder of the sum to the decedent as attorney for the defendant.
The assignees were given no notice of the garnishment proceedings, and neither they nor the plaintiff were served with the motion or order nor given any notice of the hearing on this motion. A copy of the order was mailed to the plaintiff’s attorney before May 29, 1947. On May 23, 1947, the decedent, acting on behalf of the defendant, satisfied the execution docket to the amount of $4,356.50 and received payment of this amount. On May 29, 1947, the plaintiff’s attorney satisfied the execution docket in the amount of twenty-five dollars and received payment. The decedent received, as attorney’s fees, one third of the amount paid to the defendant.
On August 29, 1947, the plaintiff voluntarily paid into court the further sum of $46’26, which was ordered paid to the defendant and was drawn down by the decedent and defendant on May 29, 1952, and retained by them.
On June 9, 1947, the assignees filed a complaint in inter*225vention in the suit between the defendant and Haley. The decedent demurred thereto on behalf of the defendant, and the demurrer was sustained in March, 1951.
In April, 1950, the assignees instituted an action in the Pierce county superior court against the plaintiff to recover the identical amount due George Haley and wife, which (with the exception of the twenty-five dollars attorney’s fee) had been paid to the defendant and decedent. This suit on appeal eventuated in a judgment against the plaintiff for this amount, plus interest from the date the money was paid and costs. See Portland Ass’n of Credit Men v. Earley, 42 Wn. (2d) 273, 254 P. (2d) 758. On June 8, 1953, the plaintiff was compelled to pay the sum of $6,402.24 in full satisfaction of the judgment, including costs.
Summons and complaint in the present action were filed with the clerk of the court at Kelso, Washington, on April 24, 1953; personal service of process was obtained against the decedent and the executrix on April 28,1953, and against the defendant on October 5,1953.
The trial court concluded that the judgment or order in garnishment of May 23, 1947, was not obtained by fraud; that the action was for money had and received, and that as to the original sum of $4,381.50 paid into court by the plaintiff, the cause of action for its recovery was barred by the statute of limitations. Judgment was entered for the plaintiff in the amount of $46.26, with interest at the rate of six per cent per annum from May 29,1952, and costs. The plaintiff has appealed from that portion of the judgment which denied recovery of the amount which was withdrawn by the defendant and the decedent on May 29, 1947, contending that the statute of limitations began to run when he paid the judgment obtained against him by the assignees.
In Portland Ass’n of Credit Men v. Earley, supra, this court held that the defendant (the plaintiff in this action) was not protected by the provisions of Rem. Rev. Stat., §§ 693 to 696, RCW 7.32.180-210, because, having paid the money owed by him into court before judgment was entered, he could not show that the indebtedness was paid “under the judgment of the court.” It was pointed out that, *226in order to protect himself from a subsequent suit by the assignees, of whose claim he had notice, the plaintiff should have interpleaded the assignees, under the provisions of Rem. Rev. Stat., §§ 198 to 200, RCW 4.08.150-170.
The executrix (the only defendant filing a brief in this appeal) characterizes this action as a collateral attack on the judgment rendered in the garnishment proceeding. Upon the trial court’s findings, and under the holding of Portland Ass’n of Credit Men v. Earley, supra (that the money was not paid under the judgment), we cannot accept this view. The plaintiff’s right to recover arises out of the equitable doctrine of indemnity.
It is no longer questioned that the claim of the assignees, who were not parties to the garnishment proceeding and had no notice thereof, was superior to that of the defendant. In Bellingham Bay Boom Co. v. Brisbois, 14 Wash. 173, 44 Pac. 153, 46 Pac. 238, this court said:
“There is nothing in the law respecting garnishment or attachment preventing a creditor from assigning in good faith and for a valuable consideration any debt which may be due to him, and, under our statute, the assignee of the debt may maintain an action in his own name against the debtor, even though the assignor may have an interest in the debt assigned. Code of Procedure, § 145. It is true that the statute provides that debts and credits are subject to attachment and garnishment (Code Proc., §§ 300, 305, 306 and 523), but if the debt sought to be garnished is not, at the time, in fact due and owing from the garnishee to the attachment or judgment debtor, it necessarily follows that there is nothing upon which the writ can operate, unless it be true, as some courts have held, that an assignment is of no effect as to third persons until notice thereof is given to the garnishee. The garnisher can get no better right to the debt garnished than his debtor has, and if the latter has no right in or to the debt, the former acquires none by his garnishment.”
Both the plaintiff and the defendant in this action knew of the assignment at the time of the garnishment. The plaintiff brought it to the attention of the court in his answer to the garnishment. For some reason, the court disregarded the assignment in rendering its judgment, and that judgment *227was not binding on the assignees. If the debt belonged to the assignees, it is plain that the defendant had no claim upon it. Nevertheless, she was paid. As a result of this payment, the assignees had a cause of action against her for money had and received.
An action for money had and received may be maintained against one who has money in his hands which he is not entitled to retain as against the plaintiff, and want of privity between the parties is no obstacle to its recovery. Such an action is based upon quasi-contract, or contract implied in law. A quasi-contract derives its efficacy not from the consent of the parties but from an implication having its basis in law, independent of agreement or intention. The obligation so imposed rests upon the principle that the law will assume that a man has promised to do what it is certain he should do. King County v. Odman, 8 Wn. (2d) 32, 111 P. (2d) 228,133 A. L. R. 1440.
Where there are two parties claiming to own the same debt or chose in action, the party having the superior title may sue for money had and received against the wrongful claimant, who receives the money. Carnegie Trust Co. v. Battery Place Realty Co., 67 Misc. Rep. 452, 122 N. Y. Supp. 697, cited in Bosworth v. Wolfe, 146 Wash. 615, 264 Pac. 413, 56 A. L. R. 1117.
, As between the plaintiff and the defendant in this action, the obligation to pay the money over to the assignee was primarily that of the defendant, who had received funds to which she was not entitled. The assignee, however, elected to sue the plaintiff, who, this court decided, was not protected by the judgment because he had paid the money into court without interpleading the assignee. The judgment obtained against him by the assignees was paid in full. Although he acted in good faith, the plaintiff, as garnishee, mistook his duty and, as a result, has paid his debt twice. The defendant, on the other hand, knowing of the adverse, claim of the assignees, nevertheless obtained an ex parte order and drew down the funds rightfully belonging to another.
*228“A person who, in whole or in part, has discharged a duty which is owed by him but which as between himself and another should have been discharged by the other, is entitled to indemnity from the other, unless the payor is barred by the wrongful nature of his conduct.” Restatement, Restitution, 331, § 76.
, The cause of action arises when the payment is made, and the statute of limitations begins to run from that time. Restatement, Restitution, 343, § 77 (b). The plaintiff instituted this action in April, 1953, prior to the date his petition for rehearing in the suit by the assignees was denied. After he paid the judgment, he filed an amended complaint. His action is not barred by the statute of limitations.
The executrix argues that the plaintiff is estopped to bring his action now because he has allowed the statute of limitations to run on the defendant’s judgment and made it impossible for her to satisfy the judgment against other property of her debtor. There is missing in this situation an important element of estoppel, that of reasonable reliance. The defendant was at all times aware of the superior claim of the assignees and of the fact that the assignees were not precluded by the judgment in the garnishment proceeding. But, the invalidity of her argument of estoppel is most conclusively established when it is remembered that, until he had paid the assignees, the plaintiff’s cause of action had not arisen.
The plaintiff claimed reimbursement for his costs and attorney’s fees in the suit brought against him by the as-signee. However, he has not argued in support of this portion of his claim, and we find no justification for it. He is entitled, however, to recover the amount of the debt and interest which he was required to pay to the assignees.
An attorney who takes money from a fund or property of his client in payment of his fees, knowing of the existence of a claim against such money or property, takes subject to such prior claim. See Senneff v. Brackey, 165 Iowa 525,146 N. W. 24,1 A. L. R. 978.
- The trial court found that one third of the amount garnished was retained by the defendant’s attorney and two *229thirds was paid to the defendant. The judgment should be prorated accordingly.
The judgment is reversed and the cause remanded, with directions to enter a judgment for the plaintiff in accordance with this decision.
Hamley, C. J., Mallery, Donworth, and Weaver, JJ., concur.