Opinion by Judge W. FLETCHER; Dissent by Judge SNEED.
W. FLETCHER, Circuit Judge:These class actions arose from two disturbances in the Arizona State Prison in Safford, Arizona: one in August 1995 and the other in December of the same year. Although the district court resolved the cases separately, we consolidate them because they are factually similar and present identical legal issues. In each case, prison officials quelled the disturbance and then held all of the inmates in the affected unit out-of-doors while they investigated the incident and searched the prison buildings. The appellants, two classes of plaintiffs consisting of the inmates who were held outside, brought class actions against Arizona prison officials under 42 U.S.C. § 1983, asserting that the conditions under which they were held violated the Eighth Amendment’s prohibition against cruel and unusual punishment. The district court granted summary judgment for the defendant prison officials in each case. We conclude that unresolved issues of fact preclude summary judgment in both cases. We therefore reverse and remand.
I
Because these cases were resolved at summary judgment, we relate the facts in the light most favorable to the prisoners as the non-moving parties. See Holmes v. California Army Nat’l Guard, 124 F.3d 1126, 1132 (9th Cir.1997).
On August 14, 1995, the Graham Unit of the Arizona State Prison in Safford, Arizona housed 638 inmates. One hundred of these prisoners lived in tents; the rest were housed in permanent dormitories. Dissatisfied with the conditions in the tents, some of the inmates began setting fire to the tents and nearby structures, throwing rocks and cans, and wielding other makeshift weapons shortly after 7:00 p.m.
The prison’s Tactical Support Unit (TSU) responded to the disturbance. Officials used the public address system to order all non-participating inmates to assemble at a designated location, but only 21 inmates reported. The TSU entered the prison yard at 8:30 p.m. Over the next several hours, it was able to restore order and regain control of the facility using nonlethal weapons. By 11:15 p.m., the TSU had evacuated all of the remaining buildings, had accounted for each of the 638 inmates, and was holding them handcuffed, shackled, and lying face-down on the ground in a central location in the prison yard.
Prison officials continued to hold the inmates handcuffed and prone, though no longer shackled, in the prison yard while they conducted an investigation of the disturbance. Until the riot participants could be identified, officials considered holding the inmates in the easily secured prison yard to be the safest alternative. Placing inmates back inside the eight dormitories would have fragmented staff and allowed inmates access to objects, possibly including shanks, that could be used to cause injury. No single building was large enough to hold all of the inmates except the Multi-Purpose Building, which housed a basketball court and had only one entrance. Although this building would have provided shelter, prison officials considered it too dangerous to use under the circumstances because housing the entire inmate population in a space of that size would have created crowded conditions and thwarted their need to maintain complete physical control over the prisoners in the wake of the riot.
While the prisoners waited in the yard, eleven investigators worked around the clock to interview each inmate individually. Other officials conducted an exhaustive search of the entire unit, including all of the living spaces and each prisoner’s personal locker, for weapons and other contraband. The investigation lasted four days.
During those four days, the prisoners in the yard were exposed to the elements. The weather was humid, and the peak afternoon temperatures ranged up to 94 *730degrees, with nighttime lows around 70 degrees. Prison officials responded to the heat by “misting” the inmates with fire hoses. On the third day, officials distributed 36 bottles of sunscreen among the more than 600 inmates. Nonetheless, during one three-hour period on August 17, thirteen inmates required treatment for heat-related medical problems. The inmates were not provided with blankets or other coverings during the night. It rained during the night of August 16, but the inmates were given no means of shelter.
During some of the inmates’ time in the yard, prison officials provided no toilet facilities. For the first night, inmates were not allowed to move from a prone position for any reason, even to relieve themselves. Sometime during the morning of August 15, two portable toilets were brought onto the yard. By then, some of the inmates had urinated or defecated into their clothing, which they would wear for the rest of the time in the yard. According to the inmates, the two portable toilets could not meet the demand of so many prisoners and were often unusable, despite periodic servicing. Sometime later on August 15, the situation improved when a few of the institution’s indoor toilet facilities that had been damaged during the riot were repaired and made available to the inmates.
For each meal, the inmates received sack lunches consisting of bologna sandwiches, milk, and an orange, but, according to the plaintiffs’ deposition testimony, these lunches were routinely left in the sun for several hours before they were distributed, spoiling the meat and making much of the meal inedible. The inmates also claim that they received no drinking water until well into the second day, and that their access to drinking water was restricted thereafter. At the conclusion of the four-day riot investigation, the inmates were returned to their living quarters, and normal prison conditions were reestablished.
Several months later, on the evening of December 28, 1995, another disturbance erupted in a different unit of the Safford prison. Shortly before 6:00 p.m., between 70 and 80 of the 369 inmates in the Tonto Unit began fighting, throwing rocks, and destroying property. Again the TSU was successfully deployed, and it quickly regained control of the Unit. At 8:00 p.m., the TSU began evacuating the buildings of inmates and bringing them outdoors to the ballfield, where they were made to lie on the ground in handcuffs and ankle restraints. By midnight, all 369 inmates were lying prone on the ground. As they had in the aftermath of the Graham Unit disturbance, prison officials left the prisoners outdoors while they searched the buildings and tried to identify those inmates who had participated in the riot. This time, the officials’ investigation lasted 17 hours.
During the hours the inmates spent outside, the temperature fell to 22 degrees. They were forced to lie on the ground in whatever clothing they had been wearing when the TSU cleared their buildings. When the inmates needed to urinate, the guards allowed them to get to their knees, crawl a few feet from where they lay, and relieve themselves on the ground. Because of their close proximity to each other, inmates sometimes urinated on their neighbors; even when they did not, the urine sometimes pooled and ran onto other inmates. At around 5:00 a.m., the guards briefly allowed the inmates to get to their feet to try to restore circulation and to relieve the pain and cramping they were experiencing in the cold. A few minutes later, the guards ordered the inmates to get back on the ground. When some of the prisoners refused, the guards forced compliance with tear gas, stinger balls, and knee knockers. Once the inmates were again on the ground, the guards assigned a few of them to enter the dormitories and get blankets for the rest.
By midday on December 29, the prison officials had concluded their investigation *731and identified the instigators of the disturbance. Officials began returning the inmates to their dormitories around 1:00 p.m.
The 638 inmates incarcerated in the Graham Unit during the August 1995 riot and its aftermath filed a class action against Arizona prison officials in federal district court under 42 U.S.C. § 1983. Inmate Dennis Johnson is the lead plaintiff for the Graham Unit class. The 369 Tonto Unit inmates involved in the December 1995 incident filed a similar class action, for which inmate Leroy Baca is the lead plaintiff. Each complaint alleges that the defendant prison officials subjected the plaintiff class to unconstitutional conditions in the prison yard.
On August 26, 1998, the district court entered orders granting summary judgment for the defendants in each action. The district court concluded that, because prison officials had provided some food, drinking water, sanitation, medical care, and protection from the elements during the four days that the Graham Unit prisoners were held outdoors, the Johnson class had failed to provide evidence of sufficient harm to trigger the protections of the Eighth Amendment. Similarly, the court held that, because some of the Tonto Unit prisoners were dressed in jackets, hats, and gloves; because all of the inmates eventually received blankets; and because the inmates were subjected to cold temperatures for only one night, the Baca class also had failed to demonstrate sufficient harm to violate the Eighth Amendment.
Timely appeals were taken. We have jurisdiction to review the judgments of the district court under 28 U.S.C. § 1291, and we reverse.
II
The Eighth Amendment prohibits cruel and unusual punishment of a person convicted of a crime. U.S. Const, amend. VIII. The Amendment has not been restricted to cases challenging the length of a sentence or the nature of a punishment. Where the conditions of confinement are challenged rather than the confinement itself, a plaintiff must make two showings. First, the plaintiff must make an “objective” showing that the deprivation was “sufficiently serious” to form the basis for an Eighth Amendment violation. Wilson v. Seiter, 501 U.S. 294, 298, 111 S.Ct. 2321, 115 L.Ed.2d 271 (1991). Second, the plaintiff must make a “subjective” showing that the prison official acted “with a sufficiently culpable state of mind.” Id. The district court in these cases did not reach the question of the second required showing because, in its view, the deprivations alleged by the plaintiff classes were not sufficiently serious, to violate the Eighth Amendment. ...
Although the routine discomfort inherent in the prison setting is inadequate to satisfy the objective prong of an Eighth Amendment inquiry, “those deprivations denying ‘the minimal civilized measure of life’s necessities’ are sufficiently grave to form the basis of an Eighth Amendment violation.” Id: (quoting Rhodes v. Chapman, 452 U:S. 337, 347, 101 S.Ct. 2392, 69 L.Ed.2d 59 (1981)). Prison officials have a duty to ensure that prisoners are provided adequate shelter, food, clothing, sanitation, medical care, and personal safety.. See Farmer v. Brennan, 511 U.S. 825, 832, 114 S.Ct. 1970, 128 L.Ed.2d 811 (1994); Keenan v. Hall, 83 F.3d 1083, 1089 (9th Cir.1996); Hoptowit v. Ray, 682 F.2d 1237, 1246 (9th Cir.1982).
The circumstances, nature, and duration of a deprivation of these necessities must be considered in determining whether a constitutional violation has occurred. “The more basic the need, the shorter the time it can be withheld.” Hoptowit, 682 F.2d at 1259; see also Anderson v. County of Kern, 45 F.3d 1310, 1314, as amended, 75 F.3d 448 (9th Cir.1995) (“[A] lack of sanitation that is severe or prolonged can constitute an infliction of pain within the meaning of the Eighth Amendment.”). *732For example, the Eighth Circuit found that the Eighth Amendment had been violated where prison officials required inmates to remain outdoors in subfreezing temperatures for less than two hours, even though the inmates were provided with hip-length, lined denim coats and allowed to move freely. See Gordon v. Faber; 973 F.2d 686, 687 (8th Cir.1992). Similarly, we have suggested that depriving an inmate of a jacket could violate the Eighth Amendment under some weather conditions. See Walker v. Sumner, 14 F.3d 1415, 1421 (9th Cir.1994). More modest deprivations can also form the objective basis of a violation, but only if such deprivations are lengthy or ongoing. See Keenan, 83 F.3d at 1090-91.
The relatively brief amounts of time the members of the plaintiff classes spent in the prison yard in these cases preclude them from stating Eighth Amendment claims for minor deprivations. These plaintiffs, however, provide evidence of substantial deprivations of shelter, food, drinking water, and sanitation. This evidence, if believed, shows harm of sufficient magnitude to satisfy the objective prong of an Eighth Amendment violation.
The Johnson plaintiffs provide sworn deposition testimony and affidavits that they did not receive protection from the elements sufficient- to ward off heat-related illnesses. They testified that they received inedible food and inadequate drinking water for four days. They also testified that they did not receive adequate access to toilets to avoid soiling themselves, and they were not allowed to clean themselves thereafter. If believed, this evidence would establish deprivations sufficiently serious to satisfy the objective component of an Eighth Amendment claim.
The state has provided videotape evidence demonstrating that, repeatedly during the four days, some of the Johnson plaintiffs did receive food, drinking water, sunscreen, “misting,” and access to toilets. This videotape evidence is important and may eventually be dispositive in favor of the state. At this stage of the litigation, however, it does not overcome the plaintiffs’ evidence. Establishing that some needs of some plaintiffs were met at some times during the four days does not establish that the plaintiffs received adequate edible food and adequate amounts of drinking water, that the sunscreen or “misting” provided sufficient protection from the sun and heat, or that the sanitation was adequate. Drawing all reasonable inferences from the evidence in favor of the non-moving parties, as we must, see Wong v. Regents of the Univ. of Cal., 192 F.3d 807, 817 (9th Cir.1999), we conclude that the videotape falls short of negating the prisoners’ claims. See Nissan Fire & Marine Ins. Co., Ltd. v. Fritz Cos., Inc., 210 F.3d 1099, 1106 (9th Cir.2000). The actual conditions to which the Johnson plaintiffs were subjected on the prison yard are therefore disputed questions of material fact that cannot be resolved at summary judgment. See Fed.R.Civ.P. 56(c).
The Baca plaintiffs also provide sufficient evidence of substantial deprivations of basic human needs to withstand summary judgment. They testify principally to exposure to subfreezing temperatures and the lack of access to toilets. As in Johnson, the state supplied a videotape of the inmates on the prison yard. The videotape shows some prisoners wearing jackets and gloves. Viewed in the light most favorable to the plaintiffs, however, the videotape establishes no more than that some, but not all, members of the plaintiff class were wearing winter clothing. The state also maintains that providing the prisoners with blankets in the early morning adequately protected them from the cold, but it is undisputed that the blankets were not distributed until the inmates had been lying motionless in the dirt in subfreezing temperatures for five to nine hours. The extent and adequacy of the protection the inmates received from the cold is therefore a disputed question of *733fact. Moreover, although we have no doubt that toilets can be unavailable for some period of time without violating the Eighth Amendment, the plaintiffs in this case testify that the state imposed conditions inescapably resulting in prisoners wetting each other with urine. This evidence, if believed, would allow a fact-finder to conclude that the plaintiffs suffered a sufficiently serious deprivation to violate the Eighth Amendment.
Ill
In addition to a sufficiently serious objective harm, an Eighth Amendment violation requires a showing that the subjective state of mind of the prison officials was culpable. See Wilson, 501 U.S. at 298-99, 111 S.Ct. 2321. The state-of-mind requirement is not constant, but instead varies with the circumstances of the claim.
In Estelle v. Gamble, 429 U.S. 97, 97 S.Ct. 285, 50 L.Ed.2d 251 (1976), the Supreme Court determined that “deliberate indifference” to prisoners’ serious medical needs violates the Eighth Amendment. Id. at 105, 97 S.Ct. 285. The deliberate indifference standard requires the plaintiff to prove that “the official knows of and disregards an excessive risk to inmate health or safety.... ” Farmer v. Brennan, 511 U.S. 825, 837, 114 S.Ct. 1970, 128 L.Ed.2d 811 (1994).
Ten years later, when confronted with materially different circumstances, the Court departed from the “deliberate indifference” standard it had established in Estelle. In Whitley v. Albers, 475 U.S. 312, 106 S.Ct. 1078, 89 L.Ed.2d 251 (1986), the Court refused to find a violation of the Eighth Amendment where prison officials had shot an inmate while they tried to rescue a guard held hostage during a riot, despite the fact that prison officials had clearly shown deliberate indifference to that inmate’s safety. Explaining that the state-of-mind requirement is context-dependent, the Court held:
Where a prison security measure is undertaken to resolve a disturbance, such as occurred in this ease, that indisputably poses significant risks to the safety of inmates and prison staff, we think the question whether the measure taken inflicted unnecessary and wanton pain and suffering ultimately turns on whether the force was applied in a good faith effort to maintain or restore discipline or maliciously and sadistically for the very purpose of causing harm.
Id. at 320-21, 106 S.Ct. 1078 (internal citations omitted). In emergency circumstances, such as those that exist during a prison uprising, where prison officials must weigh the competing institutional interests of ensuring the safety of staff, visitors, and inmates, and where life-and-death decisions must be made quickly, the Court found that the deliberate indifference standard does not “adequately capture the importance of such competing obligations, or convey the appropriate hesitancy to critique in hindsight decisions necessarily made in haste, under pressure, and frequently without the luxury of a second chance.” Id. at 320, 106 S.Ct. 1078.
In contrast, where inmates challenge the conditions of confinement, the Court has applied the deliberate indifference standard rather than the heightened Whitley standard. See Wilson, 501 U.S. at 303, 111 S.Ct. 2321. The Court in Wilson reasoned that the emergency circumstances facing prison officials while quelling a disturbance would, as a general matter, be absent when officials decided such matters as what sort of food to supply, the temperature at which to keep the prison cells, and the kind of clothing to issue. See id.
In the cases now before us, the district court did not resolve the question of the prison officials’ mental state because it incorrectly held that the prisoners could not prove a sufficiently serious objective harm. But the district court did explain its view, in reliance on Whitley, “that a heightened standard of deference applies to the post-riot actions taken by the prison officials immediately after the riot, al*734though it may be less than the standard applied in the face of immediately exigent circumstances.”
In our view, the exigent circumstances the prison officials faced during the riots persisted until the officials were able successfully to remove the prisoners from the buildings and secure them in the prison yard. The prison officials’ actions and accompanying state of mind should therefore be measured against the Whitley standard for an Eighth Amendment violation until that point. Under the Whitley standard, those actions did not violate the Eighth Amendment because the officials were motivated by the sorts of penological and safety concerns which are committed to the discretion of prison officials and to which we give considerable deference.
When the inmates were in the yard, however, they were handcuffed, prone, and under armed guard. In these circumstances, the inmates presented no further danger to prison staff, the public, or each other, and prison officials were no longer required to make split-second, life- and-death decisions. Once the inmates were thus secured in the yard, the state-of-mind requirement that sufficed to show an Eighth Amendment violation was deliberate indifference.
In Farmer, the Supreme Court held that to act with deliberate indifference, an official must have actual knowledge of an excessive risk to inmate health or safety and must deliberately disregard that risk. See 511 U.S. at 837, 114 S.Ct. 1970. In these cases, the plaintiffs must show that the defendant officials had actual knowledge of the plaintiffs’ basic human needs and deliberately refused to meet those needs. Whether an official possessed such knowledge “is a question of fact subject to demonstration in the usual ways, including inference from circumstantial evidence ....” Id. at 842, 114 S.Ct. 1970.
In the cases before us, a fact-finder could conclude, based on the evidence presented by the plaintiffs seen in its most favorable light, that the defendant prison officials had actual knowledge of the inmates' exposure to the elements and need for sanitation, edible food, and adequate drinking water, and that they intentionally disregarded these conditions. In the Johnson case, inmate Johnson testified in his deposition that he heard defendant Sam Lewis, the Director of the Department of Corrections, say, "Keep them down for four days at least." He also heard guards saying "Let's keep them down, let's hurt them." In his deposition, then-Deputy Warden Glen Davis admitted that officials determined on the night of the riot-before they could know how long the investigation would take-to keep the inmates outdoors for at least three days. Davis also wrote a post-incident report in which he noted that the inmates now "have a clear understanding from this incident that type of behavior will not be tolerated. Life was not good for these inmates. They are now clear on who is administering the Institution, the consequences forthcoming from their actions and the absolute power of our Tactical Support Units." From this evidence, a finder of fact could conclude that the defendants deliberately ignored, perhaps even intentionally imposed, the sorts of conditions the Johnson plaintiffs claim to have experienced during their four days in the prison yard.
The Baca plaintiffs present similar e dence. Inmate Victor Farber provides a affidavit in which he relates that the in mates were so cold by the time of th renewed disturbance at 5:00 a.m. tha some of them asked to be shot, and "Offi. cer Ortiz laughed at the inmates [and said, `If we shoot you with these guns yoi wont [sic] get to go to the hospital-you'l just lay there in pain.'" Inmate Larr3 Harper relates hearing a guard say tha "he thought we deserved the treatment m received, if a few people cause a distur bance everyone will suffer, that he re ceived a lot of overtime and that we shouk have been left out there for two weeks.' *735Inmate Baca testifies that Deputy Warden Terry threatened to keep the inmates outside for seven days if there were any more disturbances. Inmate Large testified in his deposition that he remembered a guard telling him that the prisoners “could go to the bathroom in [their] pants and [they] could freeze.”
IV
The Eighth Amendment does not tolerate prison officials’ deliberate indifference, in the absence of exigent circumstances, to substantial deprivations of adequate shelter, food, drinking water, and sanitation. Because the plaintiff classes present evidence that, if believed by a fact-finder, would demonstrate that the defendant prison officials deliberately failed to rectify severe deprivations of basic human necessities of which they had actual knowledge, summary judgment for defendants was improperly granted.
We REVERSE and REMAND these cases for further proceedings consistent with this opinion.