244 F.3d 708 (9th Cir. 2001)
CHRISTOPHER OWENS; CYNTHIA HUTCHINS,Plaintiffs-Appellants,v.KAISER FOUNDATION HEALTH PLAN,INC., a California corporation,Defendant-Appellee.
No. 99-56466
UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT
Argued and Submitted March 8, 2001Filed March 26, 2001

[Copyrighted Material Omitted]
David G. Spivak and David L. Ross, Ross, Rose & Hammill, LLP, Beverly Hills, California, for the plaintiffs-appellants.
James A. Breslo, Seyfarth, Shaw, Fairweather & Geraldson, Los Angeles, California, for the defendant-appellee.
Appeal from the United States District Court for the Central District of California William D. Keller, District Judge, Presiding. D.C. No.CV 97-04898-WDK
Before: Arthur L. Alarcon, Melvin Brunetti, and Michael Daly Hawkins, Circuit Judges.
ALARCON, Circuit Judge:


1
Appellants Christopher Owens and Cynthia Hutchins appeal from the district court's order dismissing their Title VII action against Kaiser Foundation Health Plan, Inc. ("Kaiser") based on the doctrine of res judicata. We affirm because we conclude that the application of the doctrine of res judicata is not barred merely because they did not receive "right to sue" letters from the Equal Employment Opportunity Commission ("EEOC") until after their earlier action had been dismissed with prejudice.


2
* Appellants are African-Americans who were employed as regional chartroom clerks in Kaiser's facility in Downey, California. Kaiser relocated the facility from Downey to Ontario, California in February, 1994, at which time Appellants' employment was terminated. Thereafter, Appellants filed discrimination charges with both the EEOC and the California Department of Fair Employment and Housing, alleging that Kaiser failed to relocate them to another facility because of their race.


3
On February 14, 1995, Appellants filed an action in California state court against Kaiser, two individual supervisors, and Appellants' union, asserting causes of action for breach of implied-in-fact contract, breach of the implied covenant of good faith and fair dealing, intentional infliction of emotional distress, and fraud. The Defendants removed the action to federal court. Kaiser moved to dismiss the action based on federal preemption and the applicable statute of limitations. Appellants stipulated to a dismissal. The court dismissed without prejudice on June 19, 1995. On November 3, 1995, Appellants amended their charges of discrimination with the EEOC, adding allegations of hostile work environment and racial discrimination.


4
On November 22, 1995, Appellants filed a second action in state court against the same Defendants. They alleged the same causes of action, with the addition of a claim for breach of the duty of fair representation. The complaint alleged that Kaiser filled positions "with less qualified non-Blacks" and that this action was not based on seniority, "but was instead arbitrary and discriminatory against several African American employees . . . ." Defendants again removed the action to federal court and Kaiser moved to dismiss. Appellants did not file a response to Kaiser's motion. The district court, noting that no opposition had been filed and that Appellants' attorney had failed to respond to the court's repeated inquiries, dismissed the action with prejudice on October 25, 1996.


5
On April 4 and May 9, 1997, respectively, Owens and Hutchins received their "right to sue" letters from the EEOC. Shortly thereafter, they filed a pro se action in federal court solely against Kaiser, alleging that their terminations were unlawfully based on race. Kaiser moved to dismiss the action for failure to state a claim. The district court granted Kaiser's motion, and dismissed the complaint with leave to amend.


6
Appellants, now represented by counsel, filed an amended complaint on May 12, 1998 alleging that Kaiser had violated Title VII. Specifically, they alleged that Kaiser permitted a "racially discriminatory and hostile work environment" and that their terminations were "the result of racial, color, and cultural discrimination." The district court denied Kaiser's motion to dismiss the amended complaint for failure to state a claim. Kaiser filed its answer on August 31, 1998, and discovery commenced. The court stayed all proceedings from November 9, 1998 to January 13, 1999, however, in order to investigate whether Appellants' attorney was licensed to practice law.


7
On May 10, 1999, after discovery had resumed, Appellants moved to file a second amended complaint seeking to add claims for harassment and discrimination under state law. On May 20, 1999, before the district court had ruled on Appellants' motion, Kaiser moved to file an amended answer to assert res judicata as an affirmative defense and for judgment on the pleadings based on that doctrine. Kaiser argued that the court's dismissal with prejudice of Appellants' previous action barred any further action by Appellants based on the same underlying facts. The district court granted Kaiser's motion to amend its answer, denied Appellants' motion to amend their complaint as moot, and dismissed the action based on res judicata. Appellants filed a timely notice of appeal. We have jurisdiction pursuant to 28 U.S.C.S 1291.

II

8
Appellants contend that the district court abused its discretion by permitting Kaiser to amend its answer to assert res judicata as an affirmative defense. They contend that Kaiser's motion was untimely, submitted in bad faith, and prejudicial. We review the district court's decision to permit Kaiser to amend its answer for an abuse of discretion. Islamic Republic of Iran v. Boeing Co., 771 F.2d 1279, 1286 (9th Cir. 1985). "A district court may abuse its discretion if it does not apply the correct law or if it rests its decision on a clearly erroneous finding of material fact." Bogovich v. Sandoval, 189 F.3d 999, 1001 (9th Cir. 1999) (quoting United States v. Plainbull, 957 F.2d 724, 725 (9th Cir. 1992)).


9
A district court "shall grant leave to amend freely `when justice so requires.' " Lopez v. Smith, 203 F.3d 1122, 1130 (9th Cir. 2000) (en banc) (quoting Fed. R. Civ. P. 15(a)). We have stated that "this policy is to be applied with extreme liberality." Morongo Band of Mission Indians v. Rose, 893 F.2d 1074, 1079 (9th Cir. 1990); see also Griggs v. Pace Am. Group, Inc., 170 F.3d 877, 880 (9th Cir. 1999) (noting that inferences should be drawn "in favor of granting the motion"). In determining whether leave to amend is appropriate, the district court considers "the presence of any of four factors: bad faith, undue delay, prejudice to the opposing party, and/or futility." Griggs, 170 F.3d at 880.


10
Appellants contend that Kaiser acted in bad faith because Kaiser failed "to offer a plausible explanation for their delayed res judicata application." We disagree. Kaiser offered substantial competent evidence to explain the delay. Kaiser substituted counsel shortly after Appellants filed their first amended complaint, and offered evidence that new counsel had not represented Kaiser in the prior action and was not aware that the prior action had been dismissed with prejudice. Moreover, Kaiser's new counsel offered a credible explanation for his belated discovery that Appellants' action was barred by res judicata: He researched the procedural history of the action in the course of determining whether to oppose Appellants' motion to file a second amended complaint. Immediately upon learning of the availability of the res judicata defense, Kaiser moved to amend its answer. The district court did not clearly err in finding that Kaiser did not act in bad faith.


11
Appellants also contend that they suffered prejudice when Kaiser was permitted to amend its answer. This assertion also lacks merit. The amendment caused no delay in the proceedings and required no additional discovery. See Lockheed Martin Corp. v. Network Solutions, Inc., 194 F.3d 980, 986 (9th Cir. 1999) (stating that "[a] need to reopen discovery and therefore delay the proceedings supports a district court's finding of prejudice from a delayed motion to amend . . . ."). Appellants do not dispute that permitting Kaiser to amend its answer did not require Appellants to incur substantial additional litigation expenses. Nonetheless, Appellants argue that they were prejudiced because they incurred substantial litiga-tion expenses before Kaiser moved to amend its answer. Appellants cite no case holding that prejudice should be measured by litigation expenses incurred before a motion to amend is filed. While we agree that delaying assertion of an affirmative defense for the purpose of forcing a party to incur unnecessary expenses would demonstrate bad faith, there is no evidence that Kaiser acted with such a purpose. Appellants have failed to demonstrate that the district court clearly erred in finding that Kaiser's amendment was not prejudicial.


12
Appellants further argue that the district court abused its discretion because Kaiser unreasonably delayed the filing of its motion to amend. As discussed supra, Kaiser moved to amend as soon as it became aware of the applicability of the res judicata defense. Assuming arguendo that Kaiser had unreasonably delayed the filing of the motion to amend its answer, "[u]ndue delay by itself . . . is insufficient to justify denying a motion to amend." Bowles v. Reade , 198 F.3d 752, 758 (9th Cir. 1999). We conclude that the district court did not abuse its discretion by permitting Kaiser to amend its answer.

III

13
Appellants alternatively contend that Kaiser waived its right to assert the doctrine of res judicata by failing to raise it as an affirmative defense in its answer or in its prior motions to dismiss. We review this issue de novo. Kern Oil & Ref. Co. v. Tenneco Oil Co., 840 F.2d 730, 735 (9th Cir. 1988). In prior cases "[w]e have liberalized the requirement that defendants must raise affirmative defenses in their initial pleadings." Magana v. Commonwealth of the N. Mariana Islands, 107 F.3d 1436, 1446 (9th Cir. 1997); see also Rivera v. Anaya, 726 F.2d 564, 566 (9th Cir. 1984) (similar language). A defendant may thus raise an affirmative defense for the first time in a motion for judgment on the pleadings, but "only if the delay does not prejudice the plaintiff." Magana, 107 F.3d at 1446; see also Healy Tibbitts Constr. Co. v. Ins. Co. of N. Am., 679 F.2d 803, 804 (9th Cir. 1982) (similar language).


14
As discussed supra, Appellants were not prejudiced by Kaiser's late assertion of res judicata. Indeed, Appellants may not demonstrate prejudice based solely on the untimely assertion of res judicata because this affirmative defense would have been dispositive had Kaiser asserted it when the action was filed. See Wyshak v. City Nat'l Bank, 607 F.2d 824, 826 (9th Cir. 1979) (holding that plaintiff was not prejudiced by assertion of statute of limitations defense in amended answer because the defense would have been "effective at the outset of [plaintiff's] suit."). Appellants argue that Kaiser should be estopped from asserting res judicata because Kaiser admitted that it was aware of Appellants' previous actions when it moved to dismiss the instant action. We conclude, however, that Kaiser's knowledge that Appellants' previous action hadbeen dismissed is insufficient to demonstrate waiver of the affirmative defense of res judicata in the absence of any representation by Kaiser that it did not intend to assert that defense before trial. Thus, Kaiser did not waive its right to assert res judicata by failing to plead it in Kaiser's original answer.

IV

15
Appellants also contend that the district court erred in granting Kaiser's motion for judgment on the pleadings. We review de novo an award of judgment on the pleadings. Nelson v. City of Irvine, 143 F.3d 1196, 1200 (9th Cir. 1998). "A judgment on the pleadings is properly granted when, taking all the allegations in the pleadings as true, the moving party is entitled to judgment as a matter of law." Id.


16
"Res judicata, also known as claim preclusion, bars litigation in a subsequent action of any claims that were raised or could have been raised in the prior action." W. Radio Servs. Co. v. Glickman, 123 F.3d 1189, 1192 (9th Cir. 1997). The doctrine is applicable whenever there is "(1) an identity of claims, (2) a final judgment on the merits, and (3) identity or privity between parties." Id. Appellants contend that res judicata does not apply because the parties and the claims in the two actions were not the same. There is no genuine dispute, however, regarding the identity of the parties -Owens and Hutchins were plaintiffs and Kaiser defended in both actions. There is, however, some difference in the nature of the claims. Appellants' previous action alleged wrongful termination and various state law claims based on breach of contract. The instant action alleged Title VII claims of discriminatory termination, hostile work environment, and wrongful retaliation. Appellants contend that their latter claims are "distinctly different" and "not the subject of the prior action.""The central criterion in determining whether there is an identity of claims between the first and second adjudications is `whether the two suits arise out of the same transactional nucleus of facts.' " Frank v. United Airlines, Inc., 216 F.3d 845, 851 (9th Cir. 2000) (citation omitted). The district court concluded that the allegations in both complaints "clearly arise from the same transactional nucleus of facts. " The record supports this finding. Both causes of action are predicated on racial discrimination and allege the same circumstances regarding Appellants' terminations. Although the current action also alleges retaliation and hostile work environment, these are "all grounds for recovery which could have been asserted, whether they were or not, in a prior suit between the same parties . . . on the same cause of action." Gregory v. Widnall, 153 F.3d 1071, 1074 (9th Cir. 1998) (holding that res judicata bars consideration of a hostile work environment claim that could have been raised in a prior action between the same parties) (internal quotation marks and citation omitted). As the district court correctly noted, theadditional allegations of discrimination are "related to the same set of facts as the allegations in plaintiffs' 1995 complaint for wrongful discharge, and . . . the two cases could have conveniently been tried together." See Feminist Women's Health Ctr. v. Codispoti, 63 F.3d 863, 868 (9th Cir. 1995) (holding that res judicata bars subsequent action when the plaintiff "had to produce substantially the same evidence in both suits to sustain its case").


17
Appellants also challenge the district court's conclusion that the dismissal of their prior action was "an adjudication on the merits." This argument fails because the prior action was dismissed with prejudice "based upon plaintiffs' failure to prosecute." Unless otherwise specified, such a dismissal "operates as an adjudication upon the merits." Fed. R. Civ. P. 41(b). Thus, "involuntary dismissal generally acts as a judgment on the merits for the purposes of res judicata . . . ." United States v. Schimmels (In re Schimmels ), 127 F.3d 875, 884 (9th Cir. 1997); see also Johnson v. United States Dep't of Treasury, 939 F.2d 820, 825 (9th Cir. 1991) (noting that dismissal for failure to prosecute is "treated as an adjudication on the `merits' for purposes of preclusion").


18
Appellants further contend that res judicata should not bar review on the merits because their counsel failed to oppose Kaiser's motion to dismiss in the previous action. The Supreme Court has made clear, however, that there is "no principle of law or equity which sanctions the rejection by a federal court of the salutary principle of res judicata." Federated Dep't Stores, Inc. v. Moitie, 452 U.S. 394, 401 (1981) (internal quotation marks and citation omitted). The Court explained that "[t]he doctrine of res judicata serves vital public interests beyond any individual judge's ad hoc determination of the equities in a particular case" and rejected any equitable exceptions to the application of res judicata based on "public policy" or "simple justice." Id. Accordingly, we reject Appellants' contention that equitable principles preclude application of res judicata in this case.

V

19
Finally, Appellants argue that res judicata cannot apply because they were barred from bringing their Title VII claims in the previous action in light of the fact that they had not yet received their "right to sue" letters from the EEOC.1 Though we have never addressed this issue in a published opinion, we now join our sister circuits in holding that Title VII claims are not exempt from the doctrine of res judicata where plaintiffs have neither sought a stay from the district court for the purpose of pursuing Title VII administrative remedies norattempted to amend their complaint to include their Title VII claims. See Heyliger v. State Univ. & Cmty. Coll. Sys. of Tenn., 126 F.3d 849, 856 (6th Cir. 1997) (holding that plaintiff was subject to claim preclusion because he failed to litigate a Title VII claim in a prior state court proceeding); Herrmann v. Cencom Cable Assocs., Inc., 999 F.2d 223, 22526 (7th Cir. 1993) (stating that "[p]arties to Title VII actions enjoy no immunity from res judicata); Woods v. Dunlop Tire Corp., 972 F.2d 36, 40-41 (2d Cir. 1992) (Title VII claim not exempt from res judicata where plaintiff made no effort in prior action to seek a stay from the district court or amend her complaint to include Title VII claim); see also Boateng v. InterAmerican Univ., Inc., 210 F.3d 56, 63 (1st Cir. 2000) (Title VII claim subject to res judicata where plaintiff received right to sue letter during pendency of first action); Jang v. United Techs. Corp., 206 F.3d 1147, 1149 (11th Cir. 2000) (adopting Title VII analysis and concluding that ADA claim was not exempt from res judicata where plaintiff failed to obtain right to sue letter during pendency of first action); Churchill v. Star Enters., 183 F.3d 184, 193-94 (3d Cir. 1999) (same).


20
Appellants had ample time to secure "right to sue" letters prior to filing their first action in November of 1995. Alternatively, they could have sought a stay from the district court pending their administrative proceedings before the EEOC. In light of Appellants' failure to exercise either option, we conclude that their Title VII claims are barred by the doctrine of res judicata.


21
AFFIRMED.


22
Each party shall bear its own costs.



Notes:


1
 Title VII requires that a plaintiff obtain a "right to sue" letter from the EEOC before filing an action. See Valenzuela v. Kraft, Inc., 801 F.2d 1170, 1172-74 (9th Cir. 1986), amended by 815 F.2d 570 (9th Cir. 1987).


