UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT
April 17, 2012
WALTER D. BALLA, PLAINTIFF-APPELLEE,
STATE OF IDAHO; IDAHO STATE BOARD OF CORRECTION, DEFENDANTS-APPELLANTS.
Appeal from the United States District Court for the District of Idaho B. Lynn Winmill, Chief District Judge, Presiding D.C. No. 1:81-cv-01165-BLW
The opinion of the court was delivered by: Kleinfeld, Senior Circuit Judge:
Argued and Submitted April 13, 2011-Seattle, Washington
Before: Andrew J. Kleinfeld, Barry G. Silverman, and Kim McLane Wardlaw,*fn1 Circuit Judges.
Opinion by Judge Kleinfeld
We address an attorneys' fees award in a class action under the Prisoner Litigation Reform Act.
This is a class action, more than a quarter century old, by Idaho state prisoners at the Idaho State Correctional Institution (ISCI). The district court initially "was not successful in obtaining attorney representation"*fn2 for the prisoners, so they litigated pro se. They went to trial and won their case. The court found, in 1984, that because of deliberate indifference, without any connection to a legitimate penological purpose, the inmates were subjected to needless pain and suffering, on account of inadequate medical and psychiatric care.*fn3 That, plus overcrowding, and inadequate attention to housing and security, contributed to stabbings, assaults, gang rape, and sexual slavery.*fn4 Close custody (the classification for especially dangerous or vulnerable prisoners) was so badly managed that "[v]irtually every young man assigned to that custody level was brutally raped."*fn5 The court issued an injunction to remedy the constitutional violations.*fn6
Subsequently the court held hearings on compliance.*fn7 The prisoners were still pro se.*fn8 In 1987, the district court ruled that overcrowding had worsened, to the point where it amounted to "the unnecessary and wanton infliction of pain."*fn9
The court now made the injunction more precise and specific to each housing unit of the prison.*fn10 The court specifically limited double-celling-that is, two inmates in one cell-for some classifications, and also limited the number of prisoners housed in some units.*fn11 The court expressed particular concern about housing "close custody inmates," who "are often volatile, violent and predatory," with others upon whom these prisoners preyed.*fn12
The injunction remained in effect in 2008 and 2009, when the facts giving rise to this case occurred. The injunction prohibited, among other things: (1) putting "close custody" prisoners two in a cell instead of one in a cell, or housing more than 78 inmates in Unit 9; (2) housing more than 108 inmates in Units 10 or 11; and (3) housing more than 144 inmates in Unit 13.*fn13 The State was further enjoined from using "any other vehicle, scheme or mechanism designed to undermine the spirit and letter" of the injunction.*fn14 No question has been raised in this case regarding the continuing validity of the injunction.
The State of Idaho moved in 2007 to terminate the twenty-year-old injunction. The district court noted that it had previously appointed the Portland law firm, Stoel Rives LLP, to represent the prisoner class, "and the law firm worked on the litigation for almost two years without being paid for its work." The firm subsequently was awarded a portion of the fees it had earned, and withdrew as counsel. Because of the State's motion, the court determined that counsel was again necessary and gave notice that "the Court will attempt to locate counsel for Plaintiffs."
In April 2007, the State withdrew its motion to terminate the injunction. Evidently the injunction was still required to rectify constitutional violations, despite the injunction's decades-long duration. The district court concluded that it "must appoint counsel to represent the interests of the class members because the inmates cannot proceed pro se." After a lack of success finding anyone else, and considering Stoel Rives's experience and competence at representing the inmates, the court reappointed the firm. Stoel Rives submitted several interim bills. After considering objections to particular charges, the court ordered payment of amounts it calculated to be due. Those interim awards have not been appealed.
This appeal arises out of a crisis at the end of 2008 and the beginning of 2009. Idaho had been housing 650 of its prisoners in private prisons in Texas and Oklahoma. Idaho decided to terminate contracts with the private prison operators in those states, both out of a desire to save money and because of concerns about staff shortages at the private prisons. In October 2008, the State terminated the Texas contract and notified the Texas prison operator that it would remove the prisoners by January 5. But Idaho did not then have facilities in which to house the Texas prisoners. By late November, with the return date less than two months away, the Department of Correction had decided that it would convert a warehouse on the prison grounds, formerly used as an upholstery shop, into a new housing unit, to be called "Unit 24." The plan was to have a big open area housing all the prisoners in bunk beds. Inmates would use toilet facilities in two trailers outside the building.
Stoel Rives learned of the upholstery warehouse plan from the newspapers. On December 11, the firm wrote the deputy attorney general handling the case that the plan would appear to violate the prohibition in the injunction against double-celling and against housing inmates on "nondesigned cell areas," that is, areas not originally intended to be used as cells. Counsel asked the State for an explanation in hopes of avoiding litigation. The State responded that it would make the project manager available for a meeting, though "due to the holidays, the time for such a meeting is somewhat limited," to December 22, 23, 28 or 29. A December 22 meeting left a number of issues unresolved. In a January 2 email, the State advised Stoel Rives that 200 inmates would live in the converted warehouse, construction was progressing but incomplete, and that the two planned outbuildings for bathroom facilities were not yet ready.
The State arranged to bring the prisoners back from Texas before the modifications to the warehouse and the toilet facilities could be completed. Before the Texas prisoners arrived, it moved 200 prisoners from other units of the Idaho prison into the warehouse, since it planned to house some of the Texas prisoners in pre-existing units. The conversion project was behind schedule, but the State did not reschedule the return of the Texas prisoners. Only one of the two planned outdoor bathroom trailers was on-site, and it was not functioning. Because the bathroom outbuildings were not yet ready, the 200 inmates already moved into the warehouse would have to share 4 toilets, 3 urinals, and 4 sinks already built into the warehouse, and would have to be transported to other units for showers. The inmates who were moved into the warehouse were notified only about 45 minutes in advance that they would be moving. Correctional officers confiscated valuable electronic items for storage elsewhere. There was a shortage of plastic totes in which the prisoners were to store their personal effects. The bunk beds in the warehouse were lower quality than those in the other units. The district court found that many prisoners "were upset about their new living conditions."
The State's plan failed immediately, even before the prisoners returning from Texas arrived. On January 2, after the lights were turned down for the night and within a few hours of being moved to the warehouse, the 200 inmates rioted. The prison lost control. The riot "tore the place apart." Only two guards were in the warehouse unit. They retreated to a plexiglass-shielded control room, a protective structure in the partially converted upholstery shop. The inmates were unable to break through the plexiglass shield to get at the guards. But, "[u]ndaunted, inmates climbed onto the roof of the room and began to stomp a hole through the plywood." Fortunately, before the inmates succeeded, the two guards broke a window with a shovel and escaped from the rioting prisoners. The inmates then broke through into the control room, set a small fire, and rushed through the exterior doors and out of the building.
The State now had an already overcrowded prison and a destroyed warehouse it had intended to use to accommodate the 300 returning Texas prisoners. They were still not back. Despite the now unusable converted warehouse facility, the state went ahead with flying 300 inmates back from Texas, there being no better alternative. The Texas facility had arranged to cease operating when the Idaho prisoners left, and the local jails in Idaho could not hold the incoming prisoners from Texas. When Stoel Rives had met with State officials and the district judge, the director of the Department of Correction said they would do "everything possible" to end the double-celling within 60 days. The director did not give an assurance of a date when the State would bring itself into compliance with the existing injunction, just an aspiration.
Because the upholstery shop had not been a subject of the injunction, the housing conditions there did not violate its express terms, though the conditions might have violated the "spirit and letter" catch-all clause. But because the riot had made it unusable, and the State had brought back the Texas inmates anyway, it violated the letter of the injunction by double-celling inmates in the pre-existing units. The State acknowledged that it had violated the population limits in letters to both Stoel Rives and the Court on January 5, 2009, though it noted this was because the upholstery warehouse had been destroyed. Stoel Rives responded with letters and telephone calls to try to work out a plan to bring the State into compliance. The State responded that it intended to end prohibited double-celling by March 1, but that plans for the warehouse had not been finalized. When Stoel Rives complained of the lack of a firm commitment to any date and a lack of any explanation of why roughly two months was necessary, the State responded that in its view that amount of time was "reasonable" and "realistic" considering "the realities of prison management."
Stoel Rives moved, on January 16, for an order to show cause why the defendants should not be held in contempt, and for an order requiring the State to quit violating the double-celling prohibition in the injunction by February 4, to pay $5,000 per day for each day of violation of the injunction, and to remove by March 1 one of the two beds and one of the two lockers from each cell where double-celling was prohibited. The State responded on January 30, a week before the hearing set for the motion, that as of the day before, "all 151 beds" violating the injunction "have been vacated." Evidently, what was "realistic" considering "the realities of prison management" changed when the state received the contempt motion. Thus by the time the contempt motion was heard on February 18, the State had complied.
The district court held two days of hearings, and, the violation of the injunction having been rectified, declined to hold the defendants in contempt. The court noted that to the extent the motion sought deadlines for compliance with the double-celling limitations, it was moot, because the State had brought itself into compliance. The court found that the defendants' preparation for the influx of 300 inmates from Texas was flawed, stating that it was "difficult to understand how Defendants believed they were going to retrofit a warehouse with the necessary facilities to contain a large group of prisoners in a little over four weeks." But the three-and-a-half week period during which the double-celling injunction provision was violated would have been considerably shorter, had the inmates not rioted. The riot created a "true exigency" in which "no good choices were open" to the State, other than the double-celling. Therefore, despite the "obvious missteps" in preparation of Unit 24, the court did not find that the State "intended to exceed the population caps before the riot occurred." The court concluded that the State's inability to comply with the double-celling provisions on account of the riot, combined with innocent intent, was a defense to contempt. The court noted that, had the State "remained noncommittal about setting a firm deadline," instead of quickly bringing itself into compliance after the contempt motion was filed, the motion for contempt "would have had much more force." The court expressed a concern that, since the State had brought itself into compliance, sanctions might be punitive rather than remedial in nature, importing the criminal rather than the civil standard. The court accordingly denied the motion to hold defendants in contempt and declined to impose sanctions for the temporary violation of the injunction.
Subsequently, Stoel Rives moved for an award of $77,608.20 in attorneys' fees, $2,249.20 in costs and expenses, plus $269.10 in postage and office supplies for the class representative. The motion was not just for the imbroglio arising out of the return of the Texas prisoners, but rather for a year and a half of monitoring, from December 11, 2007 through June 22, 2009. The State did not dispute that monitoring fees would be awardable, but disputed amounts and whether some of the work was necessary, and objected that awarding anything for the contempt motion would be erroneous, because plaintiffs had not prevailed on that motion.
The district court carefully analyzed the issues and the amounts claimed, and granted in part and denied in part. The court noted that it was undisputed that plaintiffs were the prevailing party in all three Balla cases, and reasoned that under the Prisoner Litigation Reform Act and our decision in Webb v. Ada County,*fn15 "attorneys' fees can be awarded for post-judgment work in enforcing and monitoring the court's prior judgments," without proof of a new constitutional violation. Addressing defendants' argument that counsel should not be compensated for any work on the contempt motion, the court found that even though it had denied the motion, plaintiffs' counsel "played a key role in monitoring and working with the IDOC to resolve the overcrowding issue." The court also explained that it had appointed Stoel Rives "for the specific purpose of monitoring" the injunctive relief, and that the firm's services were "inextricably intertwined" with monitoring compliance with the injunction on which plaintiffs had prevailed. "[T]he legal services were directly and reasonably incurred in monitoring the Balla injunctions." The court awarded a slightly reduced amount: $76,185.60 in attorney's fees, $1,249.20 in costs and $46.94 in postage and office supply costs for the class representative.
The State appeals the award of attorneys' fees and costs in connection with the prisoners' contempt motion.
Periodic fee awards for monitoring compliance with a final judgment are appealable if the award disposes of the attorneys' fee issue for the work performed during the time period covered by the award.*fn16 We therefore have jurisdiction under 28 U.S.C. § 1291.
 Defendants argue that because the prisoners lost on their motion to hold defendants in contempt of court, the district court erred in awarding attorneys' fees. We review attorneys' fee awards for abuse of discretion*fn17 and matters of law de novo.*fn18 The central legal question is whether, where a party previously prevailed and won a judgment, fees of a court-appointed monitor are barred for efforts leading to a motion that was denied. We conclude that the answer is maybe, in the appropriate exercise of discretion by the district court. We reject defendants' suggestion that fee awards are necessarily barred, and we conclude that the district judge acted within his discretion in awarding fees in this case.
Here are the parameters of this case. First, the prisoners were and are a prevailing party in the lawsuit. They went to trial and won a judgment. Second, their subsequently appointed counsel filed a motion to hold the defendants in contempt for violating the injunction the prisoners had won, and, because the State would not commit itself to obeying the injunction by any set date, it was reasonable to file it. Third, their filing of the motion was what the Supreme Court has called in another context*fn19 a "catalyst" spurring the defendants to conform quickly to the injunction. Fourth, the prisoners' motion was denied. And fifth, a major reason why the motion was denied is that before it was heard, the defendants brought themselves into conformity with the injunction.
Defendants argue that Buckhannon Board & Care Home, Inc. v. West Virginia Department of Health & Human Services,*fn20 and the Seventh Circuit's analysis in Alliance To End Repression v. City of Chicago,*fn21 categorically prohibit an attorneys' fee award for filing and losing a contempt motion. Defendants do not quarrel with the proposition that the motion was a catalyst speeding their conduct to conform to the injunction, but they read Buckhannon to mean that being a catalyst alone does not suffice for an award of attorneys' fees. That is too broad a reading of Buckhannon.
A. Monitoring fees after Buckhannon
 We have already decided in Prison Legal News v. Schwarzenegger that monitoring fees not resulting in additional relief are allowable after Buckhannon.*fn22 Two out of three of our sister circuits to have ruled on the matter have agreed.*fn23
The Seventh Circuit concluded otherwise, in Alliance, holding that if monitoring efforts do not produce a judgment or order, then under Buckhannon such legal work is not compensable.*fn24
Alliance emphasized that the fees in that case were incurred by lawyers with no duty to monitor the court-ordered relief,*fn25 and that the huge amount of time they put into the case, far from being a catalyst bringing about conformity with the decree, was work "down the drain."*fn26 For these reasons, we might agree with the Seventh Circuit on the result in that case, and it might limit Alliance were they faced with our case. The Seventh Circuit rule is phrased categorically-no fees without additional judicially ordered relief-so it is worth explaining why we reject such a categorical rule.
The compelling reason why a categorical rule as cited in Alliance is mistaken is that Buckhannon did not overrule Pennsylvania v. Delaware Valley Citizens' Council for Clean Air.*fn27 Delaware Valley involved a different statute, the Clean Air Act, which allows fees "whenever the court determines such award is appropriate."*fn28 But the Court did not uphold fees for post-judgment work because of the greater liberality of the statute. Instead, it applied the same standard as that for civil rights cases under the "prevailing party" provision of 42 U.S.C. § 1988(b).*fn29 That makes Delaware Valley applicable to the "prevailing party" issue in this case. The Court noted that several circuits had held that "postjudgment monitoring of a consent decree is a compensable activity for which counsel is entitled to a reasonable fee,"*fn30 and concluded that participa- tion in the postjudgment proceedings at issue was compensable.*fn31
Buckhannon did not cite or purport in any way to overrule Delaware Valley, and the cases are easily reconciled. In Buck-hannon, the Supreme Court held that "prevailing party" fees could not be awarded to a party "that has failed to secure a judgment on the merits or a court-ordered consent decree," even though its efforts had "achieved the desired result because the lawsuit brought about a voluntary change in the defendant's conduct."*fn32 The Court concluded that, to be a "prevailing party" for purposes of § 1988(b), a party must secure some material alteration in the legal relationship between the parties, and that being a "catalyst" for change does not suffice.*fn33
 Before Buckhannon came down, we had held in Keith v. Volpe that under Delaware Valley attorneys' fees for post-judgment monitoring of a consent decree were awardable in civil rights cases, even in the absence of a contempt finding or other subsequent judicial relief.*fn34 In Prison Legal News we addressed whether Keith was still good law, and reconciled Delaware Valley and Buckhannon. We held that "prevailing party" status has been obtained and remains in effect when a party has obtained an enforceable settlement agreement or consent decree.*fn35 We rejected the Seventh Circuit's view in Alliance that only monitoring that produces a judgment or order is enforceable.*fn36 We reasoned that Keith v. Volpe was not overruled by Buckhannon, because Buckhannon "did not mention, much less overrule," Delaware Valley.*fn37
 Our precedents compel the conclusion that Stoel Rives's compliance monitoring was compensable. In Johnson v. City of Tulsa, the Tenth Circuit similarly rejected Alliance, because Alliance had erroneously treated Buckhannon as though it had overruled Delaware Valley.*fn38 Buckhannon speaks to the case where there never has been judicially ordered relief. Delaware Valley speaks to the case where there has been judicial relief, though the monitoring work is subsequent to the judicial order and produces no new order. This distinction makes practical sense for two reasons. First, injunctions do not always work effectively, without lawyers to see that the enjoined parties do what they were told to do. Second, in most cases, no orders are needed after the first, because just as night watchmen deter burglary, monitors deter violations of injunctions.
B. Compensation for a motion that was denied
The novel twist in this case is that the district court awarded what might be characterized as fees for losing. The motion for an order to show cause why the defendants should not be held in contempt was denied, because the defendants had brought themselves into conformity with the injunction between the time the motion was filed and the time it was heard, and because the State did not intentionally violate the Balla injunction. There are two aspects requiring our consideration. First, did denial of the contempt motion require denial of fees as a matter of law? And second, was the award of fees an abuse of discretion? We conclude that the answer to both questions is "No."
 The Prisoner Litigation Reform Act controls the attorneys' fees award in this case.*fn39 In actions by prisoners, it is not enough that fees are authorized under the Civil Rights Attorney's Fees Award Act of 1976.*fn40 Under the Prisoner Litigation Reform Act, fees "shall not be awarded, except to the extent that" the fee was directly and reasonably incurred in proving a violation of the plaintiff 's rights, and either the amount is proportionate to the relief ordered, or alternatively, the fee is "directly and reasonably incurred in enforcing the relief."*fn41 The statute provides in relevant part:
In any action brought by a prisoner who is confined to any jail, prison, or other correctional facility, in which attorney's fees are authorized under section 1988 of this title, such fees shall not be awarded except to the extent that-
(A) the fee was directly and reasonably incurred in proving an actual violation of the plaintiff 's rights protected by a statute pursuant to which a fee may be awarded under section 1988 of this title; and
(B)(i) the amount of the fee is proportionately related to the court ordered relief for the violation; or
(ii) the fee was directly and reasonably incurred in enforcing the relief ordered for the violation.*fn42
This statutory language allows for an argument that no fees can be awarded for any work that does not "prov[e] an actual violation," because subsection (A) is a condition for both (B)(i) and (B)(ii). We considered and rejected that argument in Webb v. Ada County.*fn43 We held in Webb that that reading had to be mistaken because if it were correct, it "would render the language of subsection (B)(ii) superfluous."*fn44 That language creates an exception to the exclusion of attorneys' fees where "the fee was directly and reasonably incurred in enforcing the relief ordered for the violation."*fn45 The Webb court continued:
If a postjudgment fee request could only be granted if the attorney's services were directly linked to a discrete constitutional violation, fees incurred "in enforcing the relief" that the court had ordered because of demonstrated previous constitutional violations, could not be awarded.*fn46
By expressly providing for fee awards for "enforcing" relief ordered, Webb held, Congress can only have meant that lawyers' enforcement work after the order providing relief be compensable, even though that monitoring does not result in a second judgment or order. That construction of § 1997e(d)(1) makes more sense of the reconciliation of Dela- ware Valley and Buckhannon than an alternative reading, because, with well-behaved defendants, "enforcing relief" is achieved by monitoring alone, and there are no subsequent judgments or orders. Under Webb, the Prisoner Litigation Reform Act's "prov[e] an actual violation" requirement is satisfied when the prisoners have previously won an injunction.
 That is not to say that once an injunction has been obtained, attorneys' fees are unrestricted. The statutory scheme should be read, under Delaware Valley, Buckhannon, Prisoners Legal News, and Webb, to mean that if prisoners file an action but do not win an order or judgment establishing that they have proved a violation of their rights, no fees may be awarded. Once they have proved a violation, as by an injunction, the subsection (A) requirement has been satisfied. Then fees may be awarded proportionally to the relief granted, under subsection (B)(i). Or alternatively, for monitoring, the limitation of subsection (B)(ii) applies: the fee is allowable only if and to the extent that it is "directly and reasonably incurred in enforcing the relief ordered" in the injunction. That reading conforms both to the statutory text and to the cases. The requirement that the court exercise discretion means it must assure that the case is not being milked by a monitor after the injunction has been obtained, for fees that are unreasonable in amount, for work not reasonably performed to enforce the relief, or for work not directly related to enforcing the relief.
 The prisoners in this case had long ago won their injunction, so subsection (A) was satisfied, and they did not have to win further judicial relief to get paid for their lawyers' work. But the prisoners not only did not win anything else, they lost, on their contempt motion. Can a fee be "directly and reasonably incurred in enforcing the relief" when the work was on a motion that was denied? Here, we conclude it can. The answer might surprise one inexperienced in litigation, but such losing motions as the one at issue here are a common and effective tool for bringing about conformity to the law.
Such motions might be seen as the opposite of a Pyrrhic victory. Despite losing the battle over the contempt motion, the prisoners nevertheless won the war by inducing the State's prompt return to compliance with the injunction.
 The district court found that even though the contempt motion was denied, Stoel Rives's efforts, including the denied motion, "played a key role" in resolving the overcrowding issue at the prison, and that such motions are appropriate "to ensure the injunctive relief is being complied with." The facts amply support the finding. Before the motion, on January 12, the best the State claimed to be able to do was use its best efforts, without any assurance of success, to conform to the injunction by the beginning of March. Stoel Rives filed the contempt motion on January 16. Thirteen days later, on January 29, more than a month earlier than its earlier anticipated date of March 1, the State was back in compliance with the injunction. This was, significantly, before the scheduled hearing on the contempt motion. The immediacy of the prison riot after the move to the warehouse shows the value of forcing the State to speed up.
The best defense against an action or motion to compel compliance with a legal obligation is compliance. Unlike the work in Alliance, a motion that brings about compliance is not work "down the drain." The object of the motion was to obtain compliance, not to win an order hopefully leading to compliance. The object was attained. If in a battle to take a hill, the adversary flees instead of fighting to a bloody defeat, the taking of the hill makes the battle a victory.
Probably the most common example of motions to compel compliance that are denied, but which are nevertheless successful as a practical matter, is in civil discovery. Frequently, interrogatories are not answered in 30 days as required by Fed. R. of Civ. P. 33(b)(2), and requests for production are not satisfied within 30 days as required by Rule 34. Because in matters of any complexity, the time limits are very short, a lawyer typically will call a noncompliant adversary a couple of weeks after the deadline, followed by a letter a few weeks after the call. If the party still has not received its discovery or an adequate assurance, the lawyer will move for an order compelling disclosure or discovery under Rule 37(a). Rule 37(a)(5)(A) requires the court to award attorneys fees in most circumstances where "the disclosure or requested discovery is provided after the motion was filed," even though in such a circumstance, there would be no order compelling the party to do what it has already done. The victory sought is getting the answers or documents, not getting an order to produce them. Thus there is nothing unusual about awarding fees for losing, when the loss is caused by the effectiveness of the legal work in bringing about performance of a legal obligation.
 In this case, the judge had discretion to consider whether Stoel Rives's work on the motion to compel conformity to the injunction was "directly and reasonably incurred in enforcing the relief." The district court acted within the bounds of its discretion in awarding fees in a reasonable amount for bringing about that conformity with the injunction. To decide whether a lawyer's bills were "reasonably incurred," a judge properly looks at whether what the lawyer did was reasonable when he did it, and compensates for time reasonably spent. Here, Stoel Rives's work was what one would expect of a lawyer working for a client that could afford its efforts but that was not indifferent to the cost. The firm showed no evidence of milking the case, and the fees were "directly and reasonably incurred."