
656 F.3d 1008 (2011)
Joseph R. DIAZ; Judith McDaniel; Keith B. Humphrey; Beverly Seckinger; Stephen Russell; Deanna Pfleger; Carrie Sperling; Leslie Kemp; Corey Seemiller, Plaintiffs-Appellees,
v.
Janice K. BREWER, in her official capacity as Governor of the State of Arizona; David Raber, in his official capacity as Interim Director of the Arizona Department of Administration and Personnel Board; Kathy Peckardt, in her official capacity as Director of Human Resources for the Arizona Department of Administration and Personnel Board, Defendants-Appellants.
No. 10-16797.
United States Court of Appeals, Ninth Circuit.
Argued and Submitted February 14, 2011.
Filed September 6, 2011.
*1009 Tara L. Borelli, Los Angeles, CA, for plaintiffs-appellees Joseph R. Diaz, et al.
*1010 Charles A. Grube, Deputy State Attorney General, Phoenix, AZ, for defendants-appellants Janice K. Brewer, et al.
Before: MARY M. SCHROEDER and SIDNEY R. THOMAS, Circuit Judges, and MARK W. BENNETT, District Judge.[*]

OPINION
SCHROEDER, Circuit Judge:
The State of Arizona appeals the district court's order granting a preliminary injunction to prevent a state law from taking effect that would have terminated eligibility for health-care benefits of state employees' same-sex partners. In a published opinion, the district court found that the plaintiffs demonstrated a likelihood of success on the merits, because they showed that the law adversely affected a classification of employees on the basis of sexual orientation, and did not further any of the state's claimed justifiable interests. Collins v. Brewer, 727 F.Supp.2d 797 (D.Ariz. 2010).[1] The court also found that the plaintiffs had established a likelihood of irreparable harm in the event coverage for partners ceased. The district court's findings and conclusions are supported by the record and we affirm.

BACKGROUND
In April of 2008, the State of Arizona administratively adopted amendments to Section 101 of Chapter 5 of Title 2 of the Arizona Administrative Code to offer access to healthcare benefits for qualified opposite-sex and same-sex domestic partners of state employees. Prior to 2008, when state employees chose to participate in the State's health insurance program, they only had the option to include their spouses and children within the defined parameters of the term "dependent." In 2008, the amendments expanded the definition of "dependent" to include qualified "domestic partners," who could be of either sex. See 14 Ariz. Admin. Reg. 1420-34 (Apr. 25, 2008).
In November of 2008, however, the Arizona voters approved Proposition 102, also known as the Marriage Protection Amendment, which amended the Arizona Constitution to define marriage as between one man and one woman: "Only a union of one man and one woman shall be valid or recognized as a marriage in this state." Ariz. Const. art. 30, § 1. On September 4, 2009, the governor of Arizona signed House Bill 2013, which included a statutory provision, Ariz.Rev.Stat. § 38-651(O) ("Section O") that redefined "dependants" as "spouses," and thus would eliminate coverage for domestic partners:
O. FOR THE PURPOSES OF THIS SECTION, BEGINNING OCTOBER 1, 2009, "DEPENDENT" MEANS A SPOUSE UNDER THE LAWS OF THIS STATE, A CHILD WHO IS UNDER NINETEEN YEARS OF AGE OR A CHILD WHO IS UNDER TWENTY-THREE YEARS OF AGE AND WHO IS A FULL-TIME STUDENT.
After a number of adjustments not at issue here, the new definition of "dependent" was slated to take effect on January 1, 2011.
A group of gay and lesbian state employees ("Plaintiffs") filed a complaint on *1011 November 17, 2009 amended on January 7, 2010, seeking injunctive and declaratory relief to redress Section O's claimed violation of their equal protection and substantive due process rights under the Fourteenth Amendment to the U.S. Constitution. According to the factual allegations of the complaint, which are not disputed, all of the plaintiffs are highly skilled state employees whose job duties are equivalent to the duties of their heterosexual colleagues. Each of the nine plaintiffs and his or her domestic partner have enjoyed a long-term, committed, and financially interdependent relationship, and would marry if Arizona law permitted same-sex couples to marry. Each plaintiff enrolled his or her domestic partner and the domestic partner's qualifying children (if any) for family coverage during the 2008 or 2009 open enrollment period. Each plaintiff, domestic partner, and partner's child met the eligibility requirements for coverage at the time of enrollment and continue to meet those requirements. Each named plaintiff would lose health insurance coverage for his or her domestic partner, and his or her partner's children if Section O were to go into effect.
The complaint also reflects that such a loss would cause all of the plaintiffs serious financial and emotional harm. For example, one of the plaintiffs, Beverly Seckinger, a Professor and Interim Director of the School of Media Arts at the University of Arizona, has been in an exclusive and financially interdependent relationship with Susan Taunton for over 22 years. The two registered as domestic partners with the City of Tucson in October 2005. Susan enrolled in the state's family coverage in 2008, and remains enrolled. Susan is the primary caregiver for her 89-year-old mother, who has dementia and needs much more caregiving help than her assisted living facility can provide. The care of her mother precludes Susan from obtaining full-time employment.
Private insurers have consistently refused to insure Susan because of her chronic asthma. Beverly's declaration stated that "[e]ven if [she] were to persuade a private insurer to provide Susan with health coverage, [she] would not be able to secure a health plan with equivalent coverage." Moreover, due to Beverly's financial support, it is possible that Susan no longer qualifies for medical coverage through the state's Medicaid program.
Another plaintiff, Joseph R. Diaz, an Associate Librarian at the University of Arizona, has been in a committed relationship for the last 17 years with Ruben E. Jiménez. Ruben enrolled in the state's family coverage in 2008 and 2009, and he relied on this coverage in making a decision to leave his low-wage job with health benefits for a more promising position without health benefits. Ruben has high cholesterol and Type 2 diabetes, and requires daily medication and testing strips which would cost approximately $300 a month out of pocket. A private insurance agent informed Joseph and Ruben that "she could not locate any individual insurance plans in Arizona that would cover a person [like Ruben] with diabetes and high cholesterol." Ruben earns $100 too much per month to qualify for indigent health care.
Defendants include the governor of Arizona, the interim Director of the Arizona Department of Administration ("ADOA"), and two other ADOA officials. They moved to dismiss the complaint on the ground that the complaint failed to state equal protection and substantive due process claims, and argued that the statute furthered valid legislative interests. It further argued that the governor was immune from suit.
*1012 Plaintiffs opposed the motion and sought a preliminary injunction barring enforcement of the law. They submitted affidavits and other material to support their position that the law did not further any legitimate financial or administrative interest of the state. The supporting materials included the analysis of an expert that the entire state expenditure for domestic partner benefits represented a tiny fraction of the total employee healthcare benefits.
In a careful order, the court considered each of the possible state interests the law might be said to further and ruled that the law and the record negated each of them. Although plaintiffs argued heightened scrutiny was required, the district court applied rational basis review, but noting that such review is more searching when a classification adversely affects unpopular groups. Collins, 727 F.Supp.2d at 804 (citing Lawrence v. Texas, 539 U.S. 558, 580, 123 S.Ct. 2472, 156 L.Ed.2d 508 (2003) (O'Connor, J., concurring)). We do not need to decide whether heightened scrutiny might be required.
While the district court noted that Section O was not discriminatory on its face, because it affected both same-sex and different-sex couples, the court held that Section O had a discriminatory effect. This is because, under Arizona law, different-sex couples could retain their health coverage by marrying, but same-sex couples could not. Id. at 802-03. Therefore, the district court granted plaintiffs' request for a preliminary injunction on equal protection grounds.
The court applied the appropriate standards for the grant of preliminary injunctive relief. See Fed.R.Civ.P. 65; see also Winter v. NRDC, 555 U.S. 7, 24-25, 129 S.Ct. 365, 172 L.Ed.2d 249 (2008); Stormans, Inc. v. Selecky, 586 F.3d 1109, 1126-27 (9th Cir.2009). It concluded that the plaintiffs had established a likelihood of success on the merits and that they were likely to suffer irreparable harm if the injunction did not issue. Collins, 727 F.Supp.2d at 811-14. In assessing the likelihood of success, the court examined each of the interests the state contended the statute furthered and found the statute was not rationally related to them. In addition, the district court tried to conceive of any additional interests to sustain Section O and concluded it could not.
The likelihood of the plaintiffs suffering irreparable harm was well documented by the plaintiffs' affidavits. The health problems of domestic partners facing loss of healthcare benefits included a life-threatening torn carotid artery, chronic asthma, and inability to obtain private insurance because of diabetes and high cholesterol. The court also considered the public interest and found it, as well as the balance of the equities, weighed in favor of granting injunctive relief. See Stormans, 586 F.3d at 1138-40.
The district court, however, denied plaintiffs' claim that the law violated substantive due process rights, Collins, 727 F.Supp.2d at 809, and that claim is not before us. The court also held that the governor was not immune from a suit seeking injunctive relief. Id. at 809-11; see Ex parte Young, 209 U.S. 123, 28 S.Ct. 441, 52 L.Ed. 714 (1908); Agua Caliente Band of Cahuilla Indians v. Hardin, 223 F.3d 1041, 1045 (9th Cir.2000). Finally, the court considered the arguments of the parties concerning a bond and ruled that plaintiffs' were not required to post one.
This appeal by the defendants followed. We have jurisdiction pursuant to 28 U.S.C. § 1292(a)(1), as an appeal of an interlocutory order for a preliminary injunction.

DISCUSSION
Defendants' principal argument on appeal is that the district court, in granting the preliminary injunction, improperly *1013 accepted all of the plaintiffs' allegations as true. This argument is premised on a fundamentally distorted misreading of the district court's opinion. The court's opinion was dealing with two separate and discrete motions. The first was the defendants' motion to dismiss the complaint. The law is well settled that in deciding such motions the court is to accept the plaintiffs' allegations as true. See Ashcroft v. Iqbal, 556 U.S. 662, 129 S.Ct. 1937, 1949, 173 L.Ed.2d 868 (2009); Hebbe v. Pliler, 627 F.3d 338, 341-42 (9th Cir.2010). The district court properly did so here and its order makes it apparent that it understood the proper application of the rule. Collins, 727 F.Supp.2d at 802.
After denying the defendants' motion to dismiss, the court then considered the plaintiffs' motion for a preliminary injunction. The court applied the appropriate standards, looking first at the likelihood of success on the merits. It reviewed each of the justifications for the law in light of the evidence in the record. Id. at 804-05. The most important was that the change furthered the state's economic interests by reducing costs.
Of particular significance to the district court was the fact that while the plaintiffs produced expert analysis on the impact of the law on the state's expenditures and found it minimal, id. at 811-12, the court was not provided any evidence of the actual amount of benefits the state paid for same-sex partners:
In opposition to the motion for a preliminary injunction, the State attaches a spreadsheet indicating that a total of 698 domestic partners participated in the State's health plan in the 2008-2009 plan year, and 893 domestic partners participated in the 2009-2010 plan year.... However, no information is provided as to the number of same-sex domestic partners participating in the State health plan, nor the total claims of same-sex domestic partners.
Id. at 812 (footnote omitted).
The district court therefore rejected what the state said was the principle justification for the statute: cost savings. Id. The defendants, on appeal, do not seriously challenge this finding.
The defendants, on appeal, also contend that the district court's order impermissibly recognized a constitutional right to healthcare. Again, this contention rests on a misunderstanding of the court's decision. The court held that the withholding of benefits for same-sex couples was a denial of equal protection. The state is correct in asserting that state employees and their families are not constitutionally entitled to health benefits. But when a state chooses to provide such benefits, it may not do so in an arbitrary or discriminatory manner that adversely affects particular groups that may be unpopular. The most instructive Supreme Court case involving arbitrary restriction of benefits for a particular group perceived as unpopular is U.S. Department of Agriculture v. Moreno, 413 U.S. 528, 93 S.Ct. 2821, 37 L.Ed.2d 782 (1973). In that case, Plaintiffs challenged the constitutionality of an amendment to the Food Stamp Act of 1964, which redefined the term "household" to limit the program's eligible recipients to groups of related individuals. Id. at 529-30, 93 S.Ct. 2821. While noting the "little legislative history" available on the amendment, the Court concluded that the legislation was aimed at groups that were unpopular. The "amendment was intended to prevent so-called `hippies' and `hippie communes' from participating in the food stamp program." Id. at 534, 93 S.Ct. 2821.
In defending the amendment under rational basis review, the government contended that Congress might rationally have thought that the amendment would *1014 prevent fraud given the relative instability of households with unrelated individuals. Id. at 535, 93 S.Ct. 2821. The Court rejected both justifications. The Court held that the "practical operation" of the amendment would allow the hippies, with means, who were allegedly abusing the program, to rearrange their housing status to retain eligibility, while excluding those who were financially unable to do so, i.e., "only those persons who are so desperately in need of aid that they cannot even afford to alter their living arrangements so as to retain their eligibility." Id. at 538, 93 S.Ct. 2821. Those excluded were like the same-sex partners in this case who, because they cannot marry, are unable to alter their living arrangements to retain eligibility. The Court concluded that the "hippie" amendment's classification was "wholly without any rational basis." Id. We must reach the same conclusion.
Here, as in Moreno, the legislature amended a benefits program in order to limit eligibility. Since in this case eligibility was limited to married couples, different-sex couples wishing to retain their current family health benefits could alter their status  marry  to do so. The Arizona Constitution, however, prohibits same-sex couples from doing so. Thus, this case may present a more compelling scenario, since the plaintiffs in Moreno were prevented by financial circumstances from adjusting their status to gain eligibility, while same-sex couples in Arizona are prevented by operation of law.
Defendants nevertheless contend on appeal that this law is rationally related to the state's interests in cost savings and reducing administrative burdens. As the district court observed, however, the savings depend upon distinguishing between homosexual and heterosexual employees, similarly situated, and such a distinction cannot survive rational basis review. The Supreme Court in Eisenstadt v. Baird, 405 U.S. 438, 92 S.Ct. 1029, 31 L.Ed.2d 349 (1972), was well aware of this principle when it quoted the eloquent words of Justice Robert H. Jackson, decrying the selective application of legislation to a small group:
The framers of the Constitution knew, and we should not forget today, that there is no more effective practical guaranty against arbitrary and unreasonable government than to require that the principles of law which officials would impose upon a minority must be imposed generally. Conversely, nothing opens the door to arbitrary action so effectively as to allow those officials to pick and choose only a few to whom they will apply legislation and thus to escape the political retribution that might be visited upon them if larger numbers were affected. Courts can take no better measure to assure that laws will be just than to require that laws be equal in operation.
Eisenstadt, 405 U.S. at 454, 92 S.Ct. 1029 (quoting Ry. Express Agency v. New York, 336 U.S. 106, 112-113, 69 S.Ct. 463, 93 L.Ed. 533 (1949) (Jackson, J., concurring)).
The state has also argued that the statute promotes marriage by eliminating benefits for domestic partners, but the plaintiffs negated that as a justification. The district court properly concluded that the denial of benefits to same-sex domestic partners cannot promote marriage, since such partners are ineligible to marry. Collins, 727 F.Supp.2d at 807. On appeal, the state has not seriously advanced this justification.
In sum, the district court correctly recognized that barring the state of Arizona from discriminating against same-sex couples in its distribution of employee health benefits does not constitute the recognition of a new constitutional right to such benefits. Rather, it is consistent with *1015 long standing equal protection jurisprudence holding that "some objectives, such as `a bare ... desire to harm a politically unpopular group,' are not legitimate state interests." Lawrence, 539 U.S. at 580, 123 S.Ct. 2472 (O'Connor, J., concurring) (quoting Moreno, 413 U.S. at 534, 93 S.Ct. 2821) (alteration in the original); see also City of Cleburne v. Cleburne Living Center, Inc., 473 U.S. 432, 447, 105 S.Ct. 3249, 87 L.Ed.2d 313 (1985). Moreover, the district court properly rejected the state's claimed legislative justification because the record established that the statute was not rationally related to furthering such interests. Collins, 727 F.Supp.2d at 807. Contrary to the state's assertions, the court did not place the burden on the state to prove a legitimate interest. After concluding that neither the law nor the record could sustain any of the interests the state suggested, the district court considered whether it could conceive of any additional interests Section O might further and concluded it could not. On appeal, the state does not suggest any interests it or the district court may have overlooked. The court ruled the plaintiffs had established a likelihood of success in showing the statute furthered no legitimate interest.
Finally, the state contends that the district court committed clear error by not considering whether plaintiffs should post a bond as required under Federal Rules of Civil Procedure Rule 65(c). Rule 65(c) provides that a district court may grant a preliminary injunction, "only if the movant gives security in an amount that the court considers proper to pay the costs and damages sustained by any party found to have been wrongfully enjoined or restrained." The district court retains discretion "as to the amount of security required, if any." Johnson v. Couturier, 572 F.3d 1067, 1086 (9th Cir.2009) (internal quotation marks and citations omitted) (emphasis in the original). Here, the parties disputed whether a bond was required. The district court considered the arguments and properly invoked its discretion not to have plaintiffs post a bond in this matter. There was no error.
AFFIRMED.
NOTES
[*]  The Honorable Mark W. Bennett, District Judge for the United States District Court for the Northern District of Iowa, sitting by designation.
[1]  On June 6, 2011, the panel granted Plaintiff Tracy Collins's unopposed motion to dismiss without prejudice.
