
584 F.3d 655 (2009)
State of TEXAS; State of California; State of Arkansas; State of Louisiana; State of Delaware; State of Illinois; State of Massachusetts, Plaintiffs-Appellants,
v.
CAREMARK, INC.; Caremark International, Inc.; Caremark International Holdings, Inc.; Medpartners, Inc., Defendants-Appellees.
Nos. 08-50354, 08-50357 to 08-50360.
United States Court of Appeals, Fifth Circuit.
July 21, 2009.
*656 Bill L. Davis, Richard E. Salisbury (argued), Bill Ralph Moss, Austin, TX, for State of TX.
Howard M. Pearl (argued), William Paul Ferranti (argued), Katie P.B. Zell, Winston & Strawn, Chicago, IL, Jennifer L. Weaver, Waller, Lansden, Dortch & Davis, Nashville, TN, Charles J. Muller, III, Strasburger & Price, San Antonio, TX, for Caremark, Inc., Caremark Intern., Inc., Caremark Intern. Holdings, Inc. and Medpartners, Inc.
Siobhan Franklin, Cal. Dept. of Justice, Medi-Cal Fraud & Elder Abuse, San Diego, CA, for State of CA.
Valerie L. Kelly, Little Rock, AR, for State of AR.
Fred Duhy, James R. Murray, Baton Rouge, LA, for State of LA.
Manisha S. Desai, Waller, Lansden, Dortch & Davis, Nashville, TN, for Caremark, Inc. in No. 08-50359.
Lorinda Holloway, Kurt Howard Kuhn, Brown McCarroll, L.L.P., Austin, TX, for States of IL, DE and MA.
Before SMITH, GARZA and CLEMENT, Circuit Judges.
EMILIO M. GARZA, Circuit Judge:
This interlocutory appeal arises out of litigation involving the United States, several individual states (the "States"), and Defendant-Appellee Caremark, Inc. ("Caremark"). The States moved, on the grounds of sovereign immunity, to dismiss an affirmative defense asserted by Caremark that the States characterize as a "counterclaim". The district court summarily denied the motion as "premature" given other threshold legal issues. The States appealed. We vacate the order and remand to the district court to consider and rule upon the sovereign immunity issue in the first instance.


*657 I
This appeal arises out of a qui tam suit that was filed by relator Janaki Ramados ("Ramados"). Ramados initiated the action by filing a complaint on her own behalf and on behalf of the United States and the states of Arkansas, California, Florida, Illinois, Louisiana, Tennessee and Texas alleging Caremark's violation of the False Claims Act (31 U.S.C. § 3729 et seq.) as well as violations of analogous provisions of state law (including the Texas Medicaid Fraud Prevention Act) and other statutory and common law duties. Soon thereafter several of the States and the United States filed notices of intervention and filed a joint complaint in intervention ("Joint Intervention Complaint"); the state of Louisiana separately filed its own complaint in intervention ("Louisiana Complaint"). Ramados subsequently filed a First Amended Complaint ("Relator's Complaint") acknowledging the interventions by the United States and the States. The United States' and States' complaints alleged that Caremark, a pharmacy benefit manager, fraudulently withheld reimbursement payments due to the States under the federal Medicaid program. Caremark responded to each complaint with motions to dismiss, which were denied by the district court.
After the district court's denial of its motions to dismiss, Caremark filed its answers. In each answer, Caremark pled the same "Seventh Affirmative Defense," which stated that it was entitled to "a set-off and/or recoupment of all amounts paid to the [plaintiffs] to which [such plaintiffs were] not entitled." In essence, Caremark asserted that, due to miscalculations Caremark had made regarding the amounts due to the States on their claims for Medicaid reimbursements, it had overpaid the States and was entitled to recover the overpayments. The States, arguing that the Seventh Affirmative Defense is actually a "counterclaim," moved to dismiss the Seventh Affirmative Defense on the grounds of sovereign immunity. The district court noted that, while the States' sovereign immunity arguments were potentially meritorious, dismissal of the Seventh Affirmative Defense was "premature"; without giving further reasons, the court denied the States' motion. The States filed a notice of interlocutory appeal. The district court subsequently issued an "Advisory to the Fifth Circuit," stating that it had denied the States' motion "because ... it was necessary to first address the numerous motions for summary judgment regarding threshold legal questions," and that the district court's "inclination ... has been to address the major legal issues in the action in logical order," with the first step being resolution of the pending summary judgment motions. The district court expressed its view that this court should not rule on the sovereign immunity issue until other legal issues were resolved and further discovery was conducted in the proceedings below.
Caremark argues that we do not have jurisdiction to consider the district court's order denying the motion to dismiss as premature. Alternatively, Caremark argues that even if we possess jurisdiction, the States have waived sovereign immunity as to Caremark's Seventh Affirmative Defense by initiating the litigation at hand. Because the district court summarily denied the States' motion without considering the merits, it did not reach the latter question.

II
We have jurisdiction to review the district court's denial of a motion to dismiss pursuant to the collateral order doctrine, which permits review of orders that "[1] conclusively determine the disputed question, [2] resolve an important issue *658 completely separate from the merits of the action, and [3] [are] effectively unreviewable on appeal from a final judgment." Will v. Hallock, 546 U.S. 345, 349, 126 S.Ct. 952, 163 L.Ed.2d 836 (2006) (quoting Puerto Rico Aqueduct & Sewer Auth. v. Metcalf & Eddy, Inc., 506 U.S. 139, 144, 113 S.Ct. 684, 121 L.Ed.2d 605 (1993)). Denials of motions to dismiss on sovereign immunity grounds fall within the collateral order doctrine, and are thus immediately appealable. McCarthy ex rel. Travis v. Hawkins, 381 F.3d 407, 411-12 (5th Cir. 2004) (citing Puerto Rico Aqueduct, 506 U.S. at 144-45, 113 S.Ct. 684).
Caremark argues that the district court's order was "tentative, informal, or incomplete," which would remove it from the ambit of the collateral order doctrine. See Swint v. Chambers County Comm'n, 514 U.S. 35, 42, 115 S.Ct. 1203, 131 L.Ed.2d 60 (1995) (quoting Cohen v. Beneficial Indus. Loan Corp., 337 U.S. 541, 546, 69 S.Ct. 1221, 93 L.Ed. 1528 (1949)). Pointing to the district court's statement that the Motions to Dismiss are "premature" given the need to resolve the "threshold legal issues" contained in the motions for summary judgment, Caremark argues that the district court has not issued a "final order" for the purposes of the collateral order doctrine.
We disagree. Because sovereign immunity protects states from suit, Puerto Rico Aqueduct, 506 U.S. at 144-45, 113 S.Ct. 684, orders denying dismissal on the basis of sovereign immunity are immediately appealable regardless of the district court's reasons for its decision. In Sherwinski v. Peterson, 98 F.3d 849, 851 (5th Cir.1996), this court maintained jurisdiction over an appeal from a district court order that denied a sovereign immunity-based motion to dismiss against the Texas Department of Criminal Justice. The district court in that case had stated that "[u]ntil the factual and legal basis of the case has been further developed, no defendants will be dismissed." Id. We held that because the very object and purpose of sovereign immunity is to protect the state from the "coercive process of judicial tribunals at the instance of private parties," and because the value of sovereign immunity is "for the most part lost as litigation proceeds past motion practice," we had jurisdiction over the appeal pursuant to the collateral order doctrine. Id.
Sherwinski controls the present question. The district court's description of the Motions to Dismiss as premature, and its stated desire to delay the issue until after the resolution of the motions for summary judgment, do not render its order "tentative, informal or incomplete." Swint, 514 U.S. at 42, 115 S.Ct. 1203. As the States point out, the denial of their motions leaves them open to potentially intrusive discovery related to Caremark's Seventh Affirmative Defensei.e., discovery into how the Medicaid Drug Rebate Program is administered, including the agreements between private drug manufacturers and the federal and state agencies that regulate Medicaid. Thus, the sovereign immunity question must be decided before further litigation proceeds; otherwise, the object and purpose of sovereign immunityto shield the states from the burden of suits to which they have not consentedis violated. See, e.g., Fed. Mar. Comm'n v. S.C. State Ports Auth., 535 U.S. 743, 760, 122 S.Ct. 1864, 152 L.Ed.2d 962 (2002). We therefore have jurisdiction over this appeal.

III
Though we have jurisdiction over the appeal, we decline to decide the merits of the sovereign immunity issue at this time. Due to the summary nature of the district court's denial of the motions to *659 dismiss, the record is insufficiently developed for us to resolve the sovereign immunity question.
The sovereign immunity issue turns on the relationship between Caremark's Seventh Affirmative Defense and the claims asserted by the States in the underlying suit. The States argue that Caremark's pleading of the Seventh Affirmative Defense is more accurately characterized as Caremark's attempt to assert a "permissive counterclaim" against the States, and thus, the States contend, they can assert sovereign immunity as a defense against these claims. Under Federal Rule of Civil Procedure 13, a counterclaim may be compulsory or permissive; it is compulsory if it "arises out of the transaction or occurrence that is the subject matter of the opposing party's claim," FED.R.CIV.P. 13(a), and permissive if it does not meet this "same transaction or occurrence" test. See FED.R.CIV.P. 13(b).
Whether States' sovereign immunity extends to Caremark's alleged "counterclaim" is controlled by this compulsory-permissive distinction. When a state initiates a lawsuit, it waives its sovereign immunity to the extent required for the lawsuit's complete determination. Clark v. Barnard, 108 U.S. 436, 448, 2 S.Ct. 878, 27 L.Ed. 780 (1883); see also Meyers ex rel. Benzing v. Tex., 410 F.3d 236, 241 (5th Cir.2005) ("Generally, the Court will find a waiver either if (1) the state voluntarily invokes federal court jurisdiction, or (2) the state makes a `clear declaration' that it intends to submit itself to federal court jurisdiction"). The state waives its sovereign immunity only as to compulsory counterclaims, however; that is, those "arising out of the same transaction or occurrence which is the subject matter of the government's suit." Frederick v. United States, 386 F.2d 481, 488 (5th Cir.1967). Sovereign immunity is not waived as to permissive counter-claims, "which do not meet the `same transaction or occurrence test' nor to [counter-]claims of a different form or nature than that sought by it as plaintiff nor to [counter-]claims exceeding in amount that sought by it as plaintiff." Id.[1]
Though Caremark maintains that its Seventh Affirmative Defense challenges an essential component of the States' claims and is thus an affirmative defense rather than a counterclaim, Caremark argues in the alternative that, even if the Seventh Affirmative Defense is considered a counterclaim, it is compulsory. Caremark contends that its reimbursements to the States for Medicaid payments failed to subtract the amounts due to the States from the federal government and from the private pharmaceutical companies. Thus, Caremark argues, its "counterclaim" is inextricably intertwined with the claims asserted by the States in the underlying suit.
Resolution of the question requires factual examination of the transactions that form the basis of the underlying complaint and the transactions that are at the heart of Caremark's "counterclaims." If, as Caremark argues, its "counterclaims" are for "recoupment," they may be considered compulsory (bringing them within the scope of the States' waiver of sovereign immunity); if, on the other hand, they are for "set-off", they may be considered permissive. See, e.g., Matter of Gober, 100 F.3d 1195, 1207-08 (5th Cir.1996) ("Recoupment is a demand asserted to diminish or extinguish the plaintiff's demand that arises out of the same transaction forming *660 the basis of the plaintiff's claim; setoff, on the other hand, arises out of a transaction extrinsic to the plaintiff's claim."). Determination of whether the "counterclaims" are for recoupment or for set-off is a factual question that must be decided with reference to the relevant Medicaid statutes and regulations. As such, it should be first addressed by the district court.
The district court improperly denied the States' motion to dismiss without considering the merits.[2] As we noted before, the sovereign immunity issue must be resolved before further litigation (including discovery and motions for summary judgment) proceeds, so that the States are not subjected to litigation to which they have not consented. Our judgment is reserved until the record is developed below. See, e.g., Helton v. Clements, 787 F.2d 1016, 1017 (5th Cir.1986) (holding that the court of appeals had jurisdiction over a district court's refusal to rule on motions to dismiss based on governmental immunity, but remanding the case for consideration of those motions.)
We therefore VACATE the district court's order denying the States' motions to dismiss on the basis of sovereign immunity as premature, and REMAND to the district court to consider and decide those motions on the merits.
NOTES
[1]  Though the rule in Frederick was applied to waiver of immunity by the United States, it is equally applicable here, as there is no reason to distinguish between waiver asserted by the United States and that asserted on the basis of state sovereign immunity. See, e.g., Regents of Univ. of New Mexico v. Knight, 321 F.3d 1111, 1126 (Fed.Cir.2003).
[2]  As a prudential matter, the district court's decision to delay ruling on the sovereign immunity issue was understandable in light of how the proceedings unfolded below. Nonetheless, our case law requires that sovereign immunity be resolved as an initial matter.
