
    Bert BROOKS, Jr., Mary Jane Wolk, M J. Resources, a partnership, Kyger Resources, Inc., a corporation formerly Kyger Company, and Phyllis Katherin Little, Plaintiffs-Appellants, v. BARBOUR ENERGY CORPORATION, Defendant-Appellee.
    Nos. 85-1370, 85-1711.
    United States Court of Appeals, Tenth Circuit.
    Nov. 5, 1986.
    
      Kenneth N. McKinney (J.R. “Randy” Baker, with him on the briefs), of McKinney, Stringer & Webster, P.C., Oklahoma City, Okla., for plaintiffs-appellants.
    Jack L. Kinzie and Bobbie T. Shell of Andrews, Davis, Legg Bixler, Milsten & Murrah, Oklahoma City, Okla., for defendant-appellee.
    Before McKAY and ANDERSON, Circuit Judges, and JOHNSON, District Judge.
    
    
      
       Honorable Alan B. Johnson, United States District Judge for the District of Wyoming, sitting by designation.
    
   McKAY, Circuit Judge.

The appellants are a group of investors consisting of Bert Brooks, Jr., Mary Jane Wolk, M.J. Resources, Inc., and Phyllis Katherin Little (the Brooks Group). The appellee, Barbour Energy Corporation (Barbour), is an Oklahoma corporation engaged in exploring for, acquiring, and developing oil and gas property. It provides investors opportunities to participate in these exploration activities.

Barbour and the Brooks Group entered into a comprehensive written agreement, which the parties referred to as the “Participation Agreement,” concerning the Brooks Group’s participation in Barbour’s acquisition and development of oil and gas property. The two parties also entered into an “Agency and Nominee Agreement” under which the Brooks Group made Barbour its agent for collecting oil revenues. The Brooks Group subsequently sued Barbour in the United States District Court for the Western District of Oklahoma, asserting that Barbour had wrongfully withheld oil and gas proceeds. The parties held an extended settlement conference before Judge Lee R. West and tentatively resolved their dispute. A court reporter made a record of this conference, and several months later the.parties entered into a written agreement memorializing the settlement. Pursuant to this settlement agreement, the court entered an order dismissing the suit with prejudice.

The settlement agreement is an eighteen page document containing convoluted waiver provisions. The Brooks Group waived and released “all claims arising out of the Participation Agreement and Agency and Nominee Agreement.” Record, vol. 2, at 13. Barbour agreed that the Brooks Group could join, but not initiate, litigation concerning two claim areas: the West Guthrie Lake prospect and the Southwest Stroud prospect. However, the agreement permitted the Brooks Group to join such litigation only if the suit asserted claims unrelated to the Participation Agreement. Id. at 13-14.

Just three months after the parties settled, the Brooks Group intervened in an already-commenced lawsuit dealing with the West Guthrie Lake prospect. The Brooks Group based their intervention on claims arising from a “letter agreement” and upon “industry custom.” Barbour moved to open the already-settled federal district court case to obtain a temporary and permanent injunction against the Brooks Group’s participation in the state court lawsuit. The district court granted Barbour’s application for an injunction. It found that the “letter agreement” was entered into pursuant to the original Participation Agreement, and concluded that “industry custom” was merged into the original Participation Agreement. Later, the district court determined that the Brooks Group had willfully and deliberately engaged in frivolous relitigation of the settled claims and awarded Barbour $30,000 in attorney’s fees.

The Brooks Group argues that the Anti-Injunction Act should have deprived the district court of jurisdiction to enjoin the state proceedings. 28 U.S.C.A. § 2283 (West 1978). The Act states: “A court of the United States may not grant an injunction to stay proceedings in a State court except as expressly authorized by Act of Congress, or where necessary in aid of its jurisdiction, or to protect or effectuate its judgments.” Id. The third exception to this Anti-Injunction Act — termed the “relitigation exception” — is designed to allow a federal court to enjoin state proceedings dealing with the same issues that it fully adjudicated on the merits. Barbour argues that, because this case was dismissed pursuant to a settlement agreement, it was not fully adjudicated on the merits and thus the Act prohibits the injunction.

The Anti-Injunction Act was enacted to preserve the independence of state judicial systems. See Commodity Futures Trading Commission v. Chilcott Portfolio Management, 713 F.2d 1477, 1484 n. 5 (10th Cir.1983). Thus, in determining whether an injunction should issue, a court should resolve doubts against issuing the injunction, see Vendo Co. v. Lektro-Vend Corp., 433 U.S. 623, 630, 97 S.Ct. 2881, 2887, 53 L.Ed.2d 1009 (1977) (plurality opinion), and narrowly construe the Act’s three exceptions, see Atlantic Coastline Rail Co. v. Brotherhood of Locomotive Engineers, 398 U.S. 281, 287, 90 S.Ct. 1739, 1743, 26 L.Ed.2d 934 (1970); see also Mitchum v. Foster, 407 U.S. 225, 92 S.Ct. 2151, 32 L.Ed.2d 705 (1972); Alton Box Board Co. v. Esprit De Corp., 682 F.2d 1267, 1271 (9th Cir.1982). Moreover, a court should limit the application of the relitigation exception “to those situations in which the state court has not yet ruled” whether the federal judgment is res judicata. Parsons Steel, Inc. v. First Alabama Bank, — U.S. —, 106 S.Ct. 768, 772, 88 L.Ed.2d 877 (1986).

Against this background, we consider the status of the dismissal of the original suit. It was a voluntary dismissal with prejudice upon an order of the court, based on the settlement agreement. This dismissal should be considered a judgment on the merits because it was entered pursuant to a settlement that resolved the substance of the disputed claims. See Harper Plastics, Inc. v. Amoco Chemicals Corp., 657 F.2d 939, 943 (7th Cir.1981). Such a dismissal by stipulation and approved by the court with prejudice is res judicata —barring a later lawsuit on the same transaction or occurrence. See Astron Industrial Associates, Inc. v. Chrysler Motor Cos. Motors Corp., 405 F.2d 958, 960 (5th Cir.1968). Whether a court may dismiss a suit with prejudice is within its discretion. See Moore v. C.R. Anthony Co., 198 F.2d 607, 608 (10th Cir.1952). Because a dismissal with prejudice by order of the court is a judgment on the merits, we hold that a federal court can enjoin a state court proceeding adjudicating an action dealing with the same transaction or occurrence that was the subject of the dismissed cause. See Harper Plastics, 657 F.2d at 943, 946-47. Thus, the relitigation exception to section 2283 gave the district court jurisdiction to enjoin the Brooks Group’s participation in the Oklahoma-court lawsuit. This injunction did not implicate the Full Faith and Credit Act, 28 U.S.C.A. § 1738 (West 1966), because the Oklahoma court had not yet ruled whether the dismissal of the federal suit was res judicata. See Parsons Steel, Inc., 106 S.Ct. at 772.

The Brooks Group also argues that, even if the district court had jurisdiction, it erred when it issued the injunction. This contention is wholly unsupported by the record. Our review of the record indicates that the suit in the Oklahoma court involved a matter that had clearly been settled in federal court. The Brooks Group claims that the Oklahoma suit did not contravene the settlement agreement because the Group sued pursuant to a “letter agreement” and “industry custom.” The “letter agreement,” however, was entered into pursuant to the Participation Agreement. Thus, any suit involving the “letter agreement” was a violation of the settlement agreement. The Brooks Group’s argument that “industry custom” gave them an independent right to sue is also without merit. The district court correctly concluded that any “industry custom” had merged into the Participation Agreement. Thus, we hold that the district court acted properly when it enjoined the Brooks Group from participating in the state lawsuit.

The Brooks Group also contends that the court erred in awarding Barbour $30,000 in attorney’s fees. The district court based this award upon a finding that the Brooks Group had engaged in “frivolous litigation.” Record, vol. 1, at 179. This circuit, however, has “insisted that a trial judge make a finding of bad intent or improper motive by the guilty party before awarding attorney’s fees.” Sterling Energy, Ltd. v. Friendly National Bank, 744 F.2d 1433, 1437 (10th Cir.1984); see also Rutledge v. Sunderland, 671 F.2d 377, 382 (10th Cir.1982); Cornwall v. Robinson, 654 F.2d 685, 687 (10th Cir.1981). Therefore, we must reverse the district court’s award of attorney’s fees. However, we have stated that an action “ ‘can be so frivolous as to reflect impermissible conduct.’ ” Rutledge, 671 F.2d at 382 (citing Americana Industries, Inc. v. Wometco de Puerto Rico, Inc., 556 F.2d 625, 628 (1st Cir.1977)). Thus, we remand this cause to the district court to determine whether the Brooks Group’s conduct was so frivolous that it evidenced bad faith or vexatiousness. If the court finds that the frivolousness rose to the level of bad faith or vexatiousness, it should award reasonable attorney’s fees to Barbour. See Sterling Energy, 744 F.2d at 1437-38.

AFFIRMED IN PART, REVERSED AND REMANDED IN PART. 
      
      
         It is undisputed that the other two exceptions to the Anti-Injunction Act do not apply.
     