
    Thom LEWIS, Appellant v. Jesse SMITH; Mary Bender; Rick Burd; Breiner; Dan Flaherty; Frank Sterner; John Doe.
    No. 08-3800.
    United States Court of Appeals, Third Circuit.
    Submitted Pursuant to Third Circuit LAR 34.1(a) Jan. 11, 2010.
    Filed Jan. 21, 2010.
    
      Don A. Bailey, Esq., Bailey, Stretton & Ostrowski, Harrisburg, PA, for Appellant.
    Howard G. Hopkirk, Esq., Office of Attorney General of Pennsylvania, Bridget E. Montgomery, Esq., Eckert, Seamans, Cherin & Mellott, Harrisburg, PA, for Ap-pellees.
    Before: SCIRICA, Chief Judge, BARRY and SMITH, Circuit Judges.
   OPINION OF THE COURT

SCIRICA, Chief Judge.

In this appeal, Thom Lewis challenges the District Court’s judgment dismissing his complaint as barred by res judicata. We will affirm.

A brief procedural history of an earlier lawsuit filed by Lewis is germane to the issue in this appeal. Lewis was the President and Chief Executive Officer of Collie Rescue of Central Pennsylvania Inc., a non-profit organization. In March 2007, Lewis filed a civil rights action under 42 U.S.C. § 1983 against several employees of the Commonwealth of Pennsylvania as well as several private citizens, Lewis v. Smith et al., No. 07-cv-512 (M.D.Pa.) (Muir, J.) {“Lewis I ”). Later that month, Lewis filed an amended complaint alleging that defendants were involved in the illegal transportation and sale of dogs in Pennsylvania and had harassed him and retaliated against him.

On July 10, 2007, Judge Muir granted defendant Curcillo’s motion under Fed. R.Civ.P. 12(b)(6) to dismiss the complaint for failure to state a claim. Later that month, the court granted in part the Commonwealth defendants’ Rule 12(b)(6) motion, dismissing all claims against all Commonwealth defendants except Deb Smith. On August 13, 2007, defendants Dan Flah-erty and Frank Sterner filed a Rule 12(b)(6) motion to dismiss. Lewis did not file a brief in opposition. Instead, on September 3, 2007, Lewis filed a second amended complaint. On September 5, 2007, Judge Muir entered an order striking the second amended complaint under Fed.R.Civ.P. 15(a) because Lewis had not obtained prior authorization from the court or written consent of the parties to file it. The September 5, 2007 order also granted Lewis an additional 20 days to file a brief in opposition to the pending motion to dismiss. On October 18, 2007, after Lewis had filed his opposition brief, Judge Muir granted Flaherty and Sterner’s motion to dismiss, thus leaving Commonwealth employee Deb Smith as the only remaining defendant in Lewis I. Lewis never appealed the court’s orders granting defendants’ motions to dismiss.

On November 2, 2007, two weeks after Judge Muir granted Flaherty and Sterner’s motion to dismiss, Lewis filed the present action, Lewis v. Smith et al., No. 07-cv-2011 (M.D.Pa.) (Jones, J.) (“Lewis II”), another § 1983 civil rights complaint. Lewis named as defendants Jesse Smith, Mary Bender, Rick Burd, John Breiner, Dan Flaherty, and Frank Sterner, all of whom were defendants in Lewis I. In his second suit, Lewis made the same general allegations regarding defendants’ involvement in the illegal transportation and sale of dogs in Pennsylvania and their retaliation against him. On August 7, 2008, Judge Jones granted defendants’ Rule 12(b)(6) motions and dismissed the complaint with prejudice, holding the action was barred by res judicata. We agree.

“The doctrine of res judicata ‘protects litigants from the burden of relit-igating an identical issue with the same party or his privy and promotes judicial economy by preventing needless litigation.’ ” Post v. Hartford Ins. Co., 501 F.3d 154, 169 (3d Cir.2007), abrogated in part, on other grounds, by Doroshow v. Hartford Life & Accident Ins. Co., 574 F.3d 230, 233-34 (3d Cir.2009) (quoting Parklane Hosiery Co. v. Shore, 439 U.S. 322, 326, 99 S.Ct. 645, 58 L.Ed.2d 552 (1979)). Three elements are required for the doctrine to take effect: (1) a final judgment on the merits must have been rendered in a prior suit; (2) the same parties or their privies must have been involved in both suits; and (3) the subsequent suit must have been based on the same cause of action as the original. Lubrizol Corp. v. Exxon Corp., 929 F.2d 960, 963 (3d Cir.1991). Each element is met in this case. First, dismissal for failure to state a claim under Rule 12(b)(6) is a final judgment on the merits for res judicata purposes. See Federated Dep’t Stores, Inc. v. Moitie, 452 U.S. 394, 399 n. 3, 101 S.Ct. 2424, 69 L.Ed.2d 103 (1981); Post, 501 F.3d at 169. Second, Lewis is the plaintiff in both Lewis I and Lewis II, and all of the defendants in Lewis II were also defendants in Lewis I. Finally, the same civil rights causes of action arising out of Lewis’s allegations of dog trafficking are at issue in both cases.

Lewis contends, however, that res judicata should not apply because of various errors allegedly committed by the Lewis I court. Specifically, Lewis contends the Lewis I court erred by striking the second amended complaint under Rule 15(a), by failing to sua sponte grant him leave to amend his complaint, and by staying discovery while motions to dismiss were pending. But these arguments should have been raised in a timely appeal. They do not render the Lewis I court’s Rule 12(b)(6) judgments “anything other than a final judgment on the merits.” Selkridge v. United of Omaha Life Ins. Co., 360 F.3d 155, 172 (3d Cir.2004). We are highly skeptical of Lewis’s claims of error, but we need not reach those issues. The United States Supreme Court has rejected the argument that res judicata does not apply when there has been error by the court in the previous action. See Moitie, 452 U.S. at 398, 101 S.Ct. 2424 (“[T]he res judicata consequences of a final, unap-pealed judgment on the merits [are not] altered by the fact that the judgment may have been wrong or rested on a legal principle subsequently overruled in another case.”). If Lewis disagreed with the Lewis I court’s rulings, he should have moved for reconsideration or filed an appeal rather than file a second action.

For the foregoing reasons, we will affirm the judgment of the District Court. 
      
      . The Commonwealth defendants were Jesse Smith, Mary Bender, Rick Burd and John Breiner (employees of the Pennsylvania Department of Agriculture, Bureau of Dog Law Enforcement); Deb Smith (an employee of the Pennsylvania Department of State); and Ron Hill, Mark Foerster, and John Downing (attorneys employed by the Pennsylvania Office of Attorney General's Charitable Trusts Section).
     
      
      . The private citizen defendants were Dan Flaherty, Frank Sterner, and Joseph Curcillo.
     
      
      . The court granted Smith’s motion for summary judgment on July 29, 2008 and entered judgment in favor of Smith and against Lewis on August 4, 2008.
     
      
      . The District Court had jurisdiction pursuant to 28 U.S.C. §§ 1331 and 1343. We have jurisdiction pursuant to 28 U.S.C. § 1291. The court granted defendants' motions to dismiss under Fed.R.Civ.P. 12(b)(6). Thus, we accept as true all allegations in the complaint and all reasonable inferences that can be drawn from them. Lubrizol Corp. v. Exxon Corp., 929 F.2d 960, 962 (3d Cir.1991). A district court’s application of the doctrine of res judicata is a question of law over which we exercise plenary review. See Jean Alexander Cosmetics, Inc. v. L’Oreal USA, Inc., 458 F.3d 244, 248 (3d Cir.2006).
     
      
      . Lewis admits the two cases are based on the same legal theories, but he contends there were factual differences between the complaints in Lewis I and Lewis II. The addition of some new facts to support his legal theories does not prevent preclusion in this case. Because the term "cause of action” cannot be precisely defined, we look to the "essential similarity of the underlying events giving rise to the various legal claims.” Davis v. U.S. Steel Supply, 688 F.2d 166, 171 (3d Cir.1982) (en banc). In this regard, we focus on "(1) whether the acts complained of and the demand for relief are the same ...; (2) whether the theory of recovery is the same; (3) whether the witnesses and documents necessary at trial are the same (that is, whether the same evidence necessary to maintain the second action would have been sufficient to support the first); and (4) whether the material facts alleged are the same.” United States v. Athlone Indus., Inc., 746 F.2d 977, 984 (3d Cir.1984) (citations omitted); see also Lubrizol Corp., 929 F.2d at 963. Focusing on these factors in light of the "essential similarity of the underlying events giving rise” to Lewis's legal claims, we find the judgment in Lewis I precludes Lewis from maintaining Lewis II.
      
     
      
      . Lewis also challenges the District Court’s December 1, 2008 order granting Flaherty and Sterner's joint motion for an extension of time to file an application for counsel fees under 28 U.S.C. § 1927 and 42 U.S.C. § 1988. We do not have jurisdiction to determine an unresolved issue of attorney’s fees and thus will dismiss the appeal to the extent it challenges the December 1, 2008 order. See Am. Soc'y for Testing & Materials v. Corrpro Cos., 478 F.3d 557, 580 (3d Cir.2007).
     