
617 P.2d 906 (1980)
48 Or.App. 579
BURLINGTON NORTHERN INC., a Delaware Corporation, Appellant,
v.
Joseph J. LESTER and Mercedes Lester, Husband and Wife, Respondents.
No. A7804-05940; CA 15583.
Court of Appeals of Oregon.
Argued and Submitted April 14, 1980.
Decided October 6, 1980.
*907 Delbert M. Johnson, Portland, argued the cause for appellant. With him on the briefs was Roger Hennagin, Portland.
Charles Paulson, Portland, argued the cause and filed the brief for respondents.
Before GILLETTE, P.J., and ROBERTS and CAMPBELL, JJ.
GILLETTE, Presiding Judge.
Plaintiff brought this action seeking recovery of money paid to defendant in consideration of a compromise and release of a personal injury claim. Both parties moved for summary judgment. The trial court granted summary judgment for defendant and plaintiff appeals.[1] We reverse.
*908 Defendant Lester (defendant) is an employee of the plaintiff railroad. On June 19, 1973, he had an accident while engaged in his employment for the railroad and claimed the railroad was liable to him for the injury under the Federal Employers' Liability Act (FELA). Thereafter, from July, 1973, through February, 1975, the railroad issued periodic advancements to defendant in response to his claim. These advancements, totalling $12,000, were to be deducted from any judgment or settlement on the claim that defendant might receive from plaintiff. In October, 1975, defendant and plaintiff settled defendant's personal injury claim for $30,000; a written release was given by defendant.
In June, 1976, defendant, despite the settlement, filed an FELA action against plaintiff in Multnomah County Circuit Court to recover damages for his 1973 injury. He brought the action because he claimed that plaintiff had violated a part of the settlement agreement. He contended that, as part of the agreement, plaintiff promised that he would not have to take switching assignments and that, despite that promise and his physical inability to do so, plaintiff was forcing him to accept such assignments.
Before trial, the parties stipulated that the prior settlement and release would not be mentioned in front of the jury. It was agreed by the court that the $30,000 would be deducted from whatever sum the jury might award to defendant, who was the plaintiff in that case. The decision not to plead the release appears to have had two independent bases: (1) As a factual matter, there was apparently significant evidence that a mutual mistake of fact between the parties tainted the release. Apparently, plaintiff had expected that defendant would be able to continue to decline switching assignments as he had been doing with plaintiff's approval since his injury.[2] (2) As a tactical matter, plaintiff wanted to avoid the possibility that, if it were aware of the settlement and release, the jury might be inclined to treat them as an admission of liability on the part of plaintiff. The jury returned a verdict for plaintiff, finding it not liable to defendant in any amount. Plaintiff requested that defendant repay the $30,000. He refused. Thereafter, plaintiff brought this action seeking restitution of the money paid pursuant to the settlement agreement.
Defendant first contends that this suit is barred by res judicata. He argues that plaintiff could have raised the issue of the release and settlement in the previous action but chose not to.
It is clear that plaintiff could have raised the issue of the $30,000 settlement in the previous lawsuit as a counterclaim. The claim for restitution, in the event defendant failed to establish that plaintiff was responsible for his injury, arose from the same set of operative facts as defendant's claim against plaintiff. This court and the Oregon Supreme Court have repeatedly stated that
"[r]es judicata applies not only to every claim included in the pleadings but also to every claim which could have been alleged under the same aggregate of operative facts which compose a single occasion for judicial relief." Taylor v. Baker, 279 Or. 139, 144, 566 P.2d 884, 888 (1977); see *909 also Troutman v. Erlandson, 287 Or. 187, 598 P.2d 1211 (1979); Dean v. Exotic Veneers Inc., 271 Or. 188, 531 P.2d 266 (1975); and Gittelsohn v. City of Cannon Beach, 44 Or. App. 247, 605 P.2d 743 (1980).
However, requiring the railroad as a defendant to raise its claim against a plaintiff or be forever barred from asserting it would, in effect, create a law of compulsory counterclaim in Oregon. The law in this state is to the contrary.[3]
The general rule is that, in the absence of a compulsory counterclaim statute:
"The defendant is not required to set up a counterclaim and his failure to do so does not preclude him from bringing a separate action against the plaintiff on the separate cause of action which was available to him as a counterclaim. This rule, however, is subject to the qualification that a party cannot recover in a separate action on a cause of action which he failed to plead in a prior action by way of setoff or counterclaim but which was necessarily adjudicated by a former judgment." Gwynn v. Wilhelm, 226 Or. 606, 610, 360 P.2d 312, 314 (1961); see also Colhouer v. Union Pacific R.R., 275 Or. 559, 563, 551 P.2d 1291 (1976); Buck v. Mueller, 221 Or. 271, 277, 351 P.2d 61 (1960); Annot., 8 A.L.R. 694 (1920).
This rule applies even in the case where the same facts "constitute both a ground for a defense and a ground for a counterclaim." Buck v. Mueller, supra, 221 Or. at 277, 351 P.2d at 64. The plaintiff's claim for restitution was not decided in the previous suit; the plaintiff is not barred from maintaining this action.
We turn now to the merits. This action arises out of the prior FELA action brought by defendant. An action brought pursuant to the Federal Employers' Liability Act is governed by federal law. Dice v. Akron, C. & Y.R. Co., 342 U.S. 359, 361, 72 S.Ct. 312, 96 L.Ed. 398 (1952); Geris v. Burlington Northern Inc., 277 Or. 381, 383, 561 P.2d 174 (1977). Both parties focus on section 5 of the federal act. That section provides:
"Any contract, rule, regulation, or device whatsoever, the purpose or intent of which shall be to enable any common carrier to exempt itself from any liability created by this chapter, shall to that extent be void: Provided, That in any action brought against any such common carrier under or by virtue of any of the provisions of this chapter, such common carrier may set off therein any sum it has contributed or paid to any insurance, relief benefit, or indemnity that may have been paid to the injured employee or the person entitled thereto on account of the injury or death for which said action was brought." 45 U.S.C. § 55.
Defendant's position is that § 5 is all inclusive: it allows settlement proceeds to be set off against a judgment award but does not provide a basis for an independent judgment by way of counterclaim or otherwise. In support of his position, defendant relies on a Missouri case, Hughes v. Mississippi River & B.T. Ry., 309 Mo. 560, 585, 274 S.W. 703, 711 (1925), wherein the court stated that
"said section [§ 55] does not authorize a counterclaim upon which a separate judgment may be based."
However, the facts in Hughes differed from those before us. In Hughes, the railroad counterclaimed for money it paid to the employee for hospital bills and other items. The issue before the court was whether the jury had considered that amount in its verdict for the employee; the court did not purport to decide the question which we consider today.
Plaintiff, too, relies on § 5. It argues that, because § 5 and federal case law allow a settlement to be set off against an increased award by a jury, it follows that, where a jury finds the railroad not liable, the employee must return any money he has received pursuant to the settlement agreement.
*910 It is true that, where a settlement and release is found to be invalid and an employee subsequently receives a judgment award, any amounts received pursuant to the settlement are credited against that award. Hogue v. Southern Railway Co., 390 U.S. 516, 518, 88 S.Ct. 1150, 20 L.Ed.2d 73 (1968); O'Tell v. New York, New Haven and Hartford R.R. Co., 236 F.2d 472 (2nd Cir.1956). However, we have found no case, and neither party cites one, in which the question arose where a jury returned a defense verdict, as it did in this case. We find the cases involving setoffs of little help. We conclude that this case is not within the scope of section 5 of the federal act. That section speaks of other matters.[4] Since the federal law does not cover this area, we turn to state substantive law.
An action for money had and received, although an action at law, is governed by equitable principles. Schlegel v. Doran, 260 Or. 270, 274, 490 P.2d 163 (1971); Hogan v. Alum Lock Shingle Corp., 214 Or. 218, 225, 329 P.2d 271 (1958). Such an action may generally be maintained "whenever one has money in his hands belonging to another, which, in equity and good conscience, he ought to pay over to that other." 58 C.J.S. Money Received § 1 (1948); see also Am.Jur.2d Contracts § 399 (1964). The railroad claims the $30,000 paid to the defendant rightfully belongs to it. The complaint alleges both repudiation and lack of consideration. The $30,000 was paid to the defendant on the condition that he release the railroad from all claims and liabilities arising out of his accident. It is undisputed that he violated this agreement by bringing suit against the railroad. See Bafico v. Southern Pacific, 244 Or. 341, 345, 417 P.2d 392 (1966). The railroad received no consideration for its money. The defendant, however, alleges that he brought suit against the railroad because the release was invalid as it had been obtained through fraud and misrepresentation and because the railroad had violated their agreement that he would not have to perform switchman's work.
An action for money had and received will lie to recover money that has been paid on a contract where there is later a failure of consideration involving a repudiation by the defendant or any other breach going to the essence of the contract. 5 Corbin on Contracts § 1108 at 579 (1964); see also Smith v. Dunn, 165 Or. 418, 423, 107 P.2d 985 (1940). The plaintiff is not entitled to recover, however, if the failure of consideration is attributable to some fault of the plaintiff. 58 C.J.S. Money Received § 5 (1948). As the court stated in Taylor et ux. v. Grant et al.; Thornton et al., 220 Or. 114, 120, 349 P.2d 282, 285 (1960):
"Where a party has paid out money on a contract, the consideration of which has failed, he may recover back the money with interest; but where the failure of consideration was caused by his own fraud or illegal conduct he has no right to recover back the money." (Quoting from Vanderpool v. Burkitt, 113 Or. 656, 667, 234 P. 289 (1925).)
This case was decided on cross-motions for summary judgment. Summary judgment is appropriate where there is no genuine issue as to any material fact and the moving party is entitled to judgment as a matter of law. ORCP 47 C. It is undisputed that the defendant violated the terms of the settlement and release by bringing suit against the railroad. The remaining question was whether the failure of consideration on the defendant's part was due to either fraud or breach of the agreement on the part of the railroad. Answering this question would first involve ascertaining what the agreement between the parties encompassed. The affidavits filed by the parties reveal a profound disagreement on this point. After the precise nature of the *911 agreement is established, there is a further issue of the railroad's alleged fraud in the inducement to be resolved. Under these circumstances, material issues of fact exist and the case must be remanded for trial.
Respondent argues that, in any event, summary judgment for defendant's wife should be sustained because there is no evidence that she received or retained any of the money. It is true that the advancements and final payment were made solely to defendant. However, there is no denial in the record by either Mrs. or Mr. Lester that she received any funds. This matter should also be determined on remand.
Reversed and remanded.
NOTES
[1]  In granting summary judgment for defendant on plaintiff's claim the court, at the same time, granted plaintiff's motion to dismiss defendant's affirmative defenses and cross-complaint. Defendant was given ten days in which to file an amended cross-complaint. Defendant did so and his claim of outrageous conduct against the railroad is currently pending in Multnomah County Circuit Court. The trial court, in granting summary judgment for defendant, specifically determined that, pursuant to ORS 18.125(1), there was no just reason for delay and final judgment for defendant was entered. Thus, this appeal is properly taken.
[2]  Plaintiff's employment relations with its train service employees are governed by a collective bargaining agreement with the United Transportation Union. As part of that agreement, railroad work, which is divided into yard service (including switching) and road service, is allocated to employees in accordance with their own preferences and their respective seniority. Generally, brakemen's duties are preferred to switchmen's duties and men with more seniority are assigned as brakemen and then conductors. Defendant's seniority was such that he was entitled to work as brakeman part of the time but also obligated to take switching assignments at times.

When the settlement agreement was entered into, plaintiff's claims representative believed that defendant would be permitted to continue to decline switching assignments as he had done since his injury; he claims, however, that no guarantee was given to defendant. Plaintiff allowed defendant to decline switching jobs until a formal complaint was made by the union. Pursuant to its union agreement, plaintiff informed defendant that thereafter he would be required to take yard assignments.
[3]  See ORCP 22 A. "Each defendant may set forth as many counterclaims, both legal and equitable, as such defendant may have against a plaintiff." Formerly ORS 16.305.
[4]  45 U.S.C. § 55 was designed to prevent employers from escaping liability and interfering with an employee's right to recover under the federal law. Akerly v. New York Cent. R. Co., 168 F.2d 812 (6th Cir.1948). It in no way prevents settlements if they are fairly entered into. Callen v. Pennsylvania R. Co., 332 U.S. 625, 68 S.Ct. 296, 92 L.Ed. 242 (1948). Our decision that the federal law is not applicable to the facts of this case does not interfere with the purpose of § 5 or defendant's FELA rights.
