
646 N.W.2d 121 (2002)
Kenneth A. LEWIS, Virgil D. Power and Sandra Williams, individually and on behalf of all others similarly situated, Plaintiffs-Appellants,
v.
STATE of Iowa, EX REL., Thomas J. MILLER, in his official capacity as Attorney General of the State of Iowa, and Iowa Department of Human Services, Defendants-Appellees.
No. 01-0659.
Court of Appeals of Iowa.
April 24, 2002.
*122 Matthew Novak and Thad J. Collins of Pickens, Barnes & Abernathy, Cedar Rapids, and John C. Cabaniss of Law Office of John C. Cabaniss, Milwaukee, WI, for appellants.
Thomas J. Miller, Attorney General, and Gordon Allen, Deputy Attorney General, for appellees.
Heard by MAHAN, P.J., and ZIMMER and EISENHAUER, JJ.
MAHAN, P.J.
The plaintiffs appeal from a district court ruling granting the defendants summary judgment. The ruling dismissed the plaintiffs' class action suit, in which they sought a declaratory judgment that they were entitled to portions of the proceeds from a 1998 settlement entered into between various tobacco companies and several states, including the State of Iowa. The plaintiffs contend the district court erred by failing to recognize that, in light of certain state and federal statutory provisions, *123 a portion of the settlement belongs to them. We affirm.
Background Facts and Proceedings. In November 1996 the State of Iowa filed a lawsuit against manufacturers of tobacco products, seeking reimbursement of Medicaid expenditures made by the State for tobacco-related health conditions. The complaint contained nine counts alleging violations of state law and requesting monetary and equitable relief. The tobacco industry defendants moved to dismiss all counts of the State's petition. Following hearing on the motion, the district court dismissed four of the nine counts. Our supreme court affirmed the district court's dismissal of the four counts. State ex rel. Miller v. Philip Morris, Inc., 577 N.W.2d 401 (1998). The court concluded that Iowa Code section 249A.6 (1997) was the exclusive remedy to the State for the recovery of the Medicaid expenditures. Id. at 405-06. The State then amended its complaint to assert claims under section 249A.6. On November 20, 1998, the lawsuit was settled. The State of Iowa and forty-five other states entered into an agreement with the tobacco companies known as the Master Settlement Agreement (MSA). The MSA required the tobacco companies to comply with various conditions, such as abiding by certain restrictions on advertising and lobbying activity. It also required the tobacco companies to make annual payments in perpetuity to the settling states. In return, the settling states gave the companies an unconditional release of a broad array of claims and potential claims based on past, present, and future conduct, acts, or omissions. Once the settlement agreement was finalized through a consent decree in December 1998, Iowa became entitled to a share of these funds. Under the MSA, the State of Iowa expects to receive approximately $1.104 billion.
The plaintiffs filed a class action for declaratory judgment on February 24, 2000. The plaintiffs are individuals who suffer or have suffered from a variety of smoking-related illnesses and who have been the recipients of medical assistance payments under Iowa's Medical Assistance Act, Iowa Code chapter 249A. The plaintiffs brought this action for a declaratory judgment on behalf of all similarly situated persons, seeking to obtain the portion of the payments to Iowa under the MSA in excess of that necessary to reimburse the State for its Medicaid expenditures for tobacco-related health conditions pursuant to 42 U.S.C. § 1396k(b), 42 C.F.R. § 433.154(c), and Iowa Code section 249A.6. The plaintiffs also seek an accounting to determine the amount of the settlement that belongs to them. The defendants filed a motion to dismiss on several grounds, which the district court denied. The defendants then filed a motion for summary judgment contending federal law and sovereign immunity barred the plaintiffs' claims. Following a hearing, the district court granted the defendants' motion. The court concluded the MSA did not release the plaintiffs' claims and the State only recovered under Iowa Code section 249A.6 amounts it already paid. The plaintiffs appeal.
Standard of Review. The general rules regarding our review of summary judgments are well settled. We review a ruling on a summary judgment motion for errors at law. Crippen v. City of Cedar Rapids, 618 N.W.2d 562, 565 (Iowa 2000); Swartzendruber v. Schimmel, 613 N.W.2d 646, 649 (Iowa 2000). To the extent the plaintiffs challenge the district court's interpretation of the applicable statutes and regulations, we review for correction of errors at law. In re Inspection of Titan Tire, 637 N.W.2d 115, 128 (Iowa 2001).
*124 A district court properly grants summary judgment when there is no genuine issue of material fact and the moving party is entitled to judgment as a matter of law. Iowa R. Civ. P. 1.981(3); Crippen, 618 N.W.2d at 564; Swartzendruber, 613 N.W.2d at 649. A factual issue is "material" only if "the dispute is over facts that might affect the outcome of the suit, given the applicable law." Fouts ex rel. Jensen v. Mason, 592 N.W.2d 33, 35 (Iowa 1999). The burden is on the party moving for summary judgment to prove the facts are undisputed. Phillips v. Covenant Clinic, 625 N.W.2d 714, 717 (Iowa 2001).
In ruling on a summary judgment motion, the court must look at the facts in a light most favorable to the party resisting the motion. Crippen, 618 N.W.2d at 565. The court must also consider on behalf of the nonmoving party every legitimate inference that can be reasonably deduced from the record. Id. An inference is legitimate if it is "rational, reasonable, and otherwise permissible under the governing substantive law." Butler v. Hoover Nature Trail, Inc., 530 N.W.2d 85, 88 (Iowa Ct.App.1994). On the other hand, an inference is not legitimate if it is "based upon speculation or conjecture." Id. In nonjury cases, summary judgment may be granted if a trial would not enhance the ability of the court to draw inferences or conclusions. Id. at 89. If reasonable minds may differ on the resolution of an issue, a genuine issue of material fact exists. Phillips, 625 N.W.2d at 718; Swartzendruber, 613 N.W.2d at 649.
Summary Judgment. The plaintiffs seek to recover the proceeds of the M.S.A. under 42 U.S.C. § 1396k(b). Section 1396k requires states that wish to participate in Medicaid to require individual beneficiaries to assign to the state any rights to support and payment of medical care by any third party. See 42 U.S.C. § 1396k(a)(1)(A).[1] The federal law then creates a distribution scheme by which any money governed by section 1396k(b) is used first to reimburse the federal government, then to reimburse the state, with any surplus paid over to the beneficiary:
Such part of any amount collected by the State under an assignment made under the provisions of this section shall be retained by the State as is necessary to reimburse it for medical assistance payments made on behalf of an individual with respect to whom such assignment was executed (with appropriate reimbursement of the Federal Government to the extent of its participation in the financing of such medical assistance), and the remainder of such amount collected shall be paid to such individual.
42 U.S.C. 1396k(b); see also 42 C.F.R. § 433.154.
*125 Congress has, however, recently amended this statute. The newly enacted statute exempts from the normal procedures by which the federal government takes it share of state recoveries "any amount recovered or paid to a State as part of the comprehensive settlement of November 1998 between manufacturers of tobacco products ... and State Attorneys General." 42 U.S.C. § 1396b(d)(3)(B)(i) (West Supp.2000). It further provides that, with the exception for certain costs associated with litigation, "a State may use amounts recovered or paid to the State as part of a comprehensive or individual settlement... for any expenditures determined appropriate by the State." 42 U.S.C. § 1396b(d)(3)(B)(ii) (emphasis added).
The State of Iowa has implemented this federal command through section 249A.6[2], which provides in pertinent part:
When payment is made by the department for medical care or expenses through the medical assistance program on behalf of a recipient, the department shall have a lien, to the extent of those payments, upon all monetary claims, which the recipient may have against third parties.
Iowa Code § 249A.6(1). Therefore, the State of Iowa can seek reimbursement only for the amount the State actually spent on medical treatment for Medicaid recipients. See id.
After a careful review of the entire record, we conclude the district court properly granted the defendants' motion for summary judgment. Under Iowa Code section 249A.6, the plaintiffs assigned to the State of Iowa their rights to collect only the amount the State had spent on medical treatment, which under 42 U.S.C. § 1396k(b) is the State's own share of the settlement proceeds. Under the plain language of the federal statute, 42 U.S.C. § 1396b(d)(3)(B)(ii) applies to all amounts received by the State pursuant to the MSA, and the State has the right, under the express terms of the statute, to use those amounts for any expenditures it determines are appropriate. Therefore, the plaintiffs' claim is barred. Accordingly, summary judgment was appropriate.
We recognize that every court, state or federal, that has considered one of these cases has dismissed it either because of sovereign immunity or because the Master Settlement Agreement was not a Medicaid settlement subject to § 1396k(b). See, e.g., Greenless v. Almond, 277 F.3d 601 (1st Cir.2002) (relying on § 1396b(d)(3)(B)(ii)); Tyler v. Douglas, 280 F.3d 116 (2d Cir.2001) (relying on § 1396b(d)(3)(B)(ii)); Harris v. Owens, 264 F.3d 1282 (10th Cir.2001) (same); Watson v. Texas, 261 F.3d 436 (5th Cir.2001) (relying on § 1396k(b)); McClendon v. Ga. Dep't of Cmty. Health, 261 F.3d 1252 (11th Cir.2001) (same); Floyd v. Thompson, 227 F.3d 1029 (7th Cir.2000) (relying on § 1396k(b) and on Wisconsin assignment law); Cardenas v. Anzai, 128 F.Supp.2d 704 (D.Haw.2001) (Eleventh Amendment); Strawser v. Lawton, 126 F.Supp.2d 994 (S.D.W.Va.2001) (same); Clark v. Stovall, 158 F.Supp.2d 1215 (D.Kan.2001) (same); Skillings v. Illinois, 121 F.Supp.2d 1235 (C.D.Ill.2000) (following Floyd while applying Illinois law); Martin v. New Mexico, 197 F.R.D. 694 (D.N.M.2000) (Eleventh Amendment); Barton v. Summers, 111 F.Supp.2d 989 (M.D.Tenn.2000) (same); State v. Superior Court, 83 Cal.App.4th 597, 99 Cal.Rptr.2d 735 (2000) (interpreting *126 portion of state code implementing federal statutory scheme); Brown v. State, 617 N.W.2d 421, (Minn.Ct.App.2000) (same).
Our conclusion is supported by the terms of the settlement agreement, which defines "Releasing Parties" as the various settling states, their subdivisions, and representatives, but which explicitly excludes from the release persons seeking "solely... private or individual relief for separate and distinct injuries." The agreement therefore preserves the plaintiffs' right to sue the tobacco manufacturers for their tobacco-related injuries and illnesses. See McClendon, 261 F.3d at 1261; see also Floyd, 227 F.3d at 1037 ("[The settlement agreement] did not purport to extinguish the claims of individual persons who were not part of the settlement process ...").
Summary. We conclude that pursuant to federal and state law the funds received under the Master Settlement Agreement are not subject to the distribution requirements of 42 U.S.C. § 1396k(b). As a result, the defendants are entitled to judgment as a matter of law. Accordingly, we affirm the district court.
AFFIRMED.
NOTES
[1]  42 U.S.C. § 1396k(a)(1)(A) provides:

(a) For the purpose of assisting in the collection of medical support payments and other payments for medical care owed to recipients of medical assistance under the State plan approved under this subchapter, a State plan for medical assistance shall (1) provide that, as a condition of eligibility for medical assistance under the State plan to an individual who has the legal capacity to execute an assignment for himself, the individual is required
(A) to assign the State any rights, of the individual or of any other person who is eligible for medical assistance under this subchapter and on whose behalf the individual has the legal authority to execute an assignment of such rights, to support (specified as support for the purpose of medical care by a court or administrative order) and to payment for medical care from any third party;
[2]  "Section 249A.6 was enacted in 1979 to permit the State to enforce its right of subrogation against persons who were legally liable to a recipient for medical expenses incurred under the provisions of the Medical Assistance Act, a joint federal and state program." State ex rel. Miller v. Philip Morris, Inc., 577 N.W.2d 401, 405 (Iowa 1998).
