The Controlled Substances Act (the Act), 21 U.S.C. § 801 et seq., forbids the manufacture and distribution of certain drugs, including marijuana. The statute categorizes drugs under five schedules and imposes restrictions on each substance according to its schedule classification. A substance will only be included in schedule I if the substance has no currently accepted medical use. For marijuana and other schedule I drugs, the only exception to the restrictions is for government-approved research projects. In 1996, California voters passed the Compassionate Use Act, which established an exception to California’s prohibitions on marijuana possession and cultivation for a patient’s medical purposes as approved by a physician. In response, Oakland Cannabis Buyers’ Cooperative (Cooperative) (defendant) organized a medical-cannabis dispensary to serve eligible patients. The United States sued the Cooperative, seeking to enjoin the Cooperative from distributing and manufacturing marijuana. The government argued that the Cooperative’s activities violated the Act. The district court granted the injunction, but the Cooperative continued to distribute marijuana. The government initiated contempt proceedings. The Cooperative defended itself on the ground that the distributions were medically necessary, requesting modification of the injunction to include a medical-necessity exemption. The district court denied the motion and held the Cooperative in contempt after finding insufficient evidence that each patient was in actual danger of imminent harm without the drug. The court then modified the injunction, empowering the government to seize the Cooperative’s property. The Cooperative appealed but later voluntarily mooted the contempt proceeding by promising compliance with the initial injunction. A live controversy still existed in the court’s denial of the Cooperative’s motion to amend the injunction, and the court of appeals considered the merits of the issue and reversed, holding that medical necessity was a legally cognizable defense under the circumstances. The case was remanded to the district court to consider the criteria for a medical-necessity exemption. The district court subsequently granted the Cooperative’s motion to modify the injunction to incorporate a medical-necessity defense. The government petitioned for a writ of certiorari to review the court of appeal’s decision. The United States Supreme Court granted certiorari.