UNPUBLISHED
UNITED STATES COURT OF APPEALS
FOR THE FOURTH CIRCUIT UNITED STATES OF AMERICA, Plaintiff-Appellant,
v. No. 97-4948 JAMES RAY STUBBS, JR., Defendant-Appellee. Appeal from the United States District Court for the Eastern District of North Carolina, at Raleigh. Malcolm J. Howard, District Judge. (CA-95-63-H) Argued: May 8, 1998 Decided: June 24, 1998 Before LUTTIG and WILLIAMS, Circuit Judges, and TRAXLER, United States District Judge for the District of South Carolina, sitting by designation.

_________________________________________________________________ Vacated and remanded by unpublished per curiam opinion.

_________________________________________________________________ COUNSEL
ARGUED: David J. Cortes, Assistant United States Attorney, Raleigh, North Carolina, for Appellant. Bobby Grey Deaver, West Jefferson, North Carolina, for Appellee. ON BRIEF: Janice McKenzie Cole, United States Attorney, Anne M. Hayes, Assistant United States Attorney, Raleigh, North Carolina, for Appellant.

_________________________________________________________________Unpublished opinions are not binding precedent in this circuit. See Local Rule 36(c).

_________________________________________________________________ OPINION
PER CURIAM: Defendant, James Ray Stubbs, Jr., was indicted on October 18, 1995, for conspiracy, mail fraud, and wire fraud in connection with his marketing activities while serving as president of AutomotiveGuaranty Corporation, a North Carolina automobile warranty company. On July 31, 1996, Stubbs pled guilty to one count of mail fraud. At the sentencing hearing, the district court determined that Stubbs' guideline range was 18 to 24 months' imprisonment, but the court departed downward and ordered the defendant to serve three years of probation, be confined for four consecutive weekends, and pay a $10,000 fine. J.A. at 42. The government appealed. We held that the downward departures were unwarranted, and vacated and remanded for "resentencing within the applicable guideline range of 18-24 months." J.A. at 45. At the resentencing hearing on October 14, 1997, the district court sentenced the defendant to 18 months' imprisonment, but ordered the Bureau of Prisons to give the defendant credit against his prison time for "time served and probationary restraints previously imposed" such that defendant would be released "12 months and one day" from the date of resentencing. J.A. at 62, 70. From the district court's order on remand, the government appeals. We reverse.The district court clearly erred in calculating the credit against sentence to which Stubbs was entitled and in ordering the Bureau of Prisons to reduce his sentence accordingly. Credit for prior custody is governed by 18 U.S.C. § 3585(b), which states as follows: A defendant shall be given credit toward the service of a term of imprisonment for any time he has spent in official detention prior to the date the sentence commences.
2Id . Although this section speaks in the passive voice, the Supreme Court held in United Statesv. Wilson , 503 U.S. 329 (1992), that section 3585(b) "does not authorize a district court to compute the credit at sentencing." Id . at 334. Rather, only the Attorney General, through the Bureau of Prisons [BOP], may compute credit. Id . at 334-35. Accordingly, the district court exceeded its power by computing and ordering the BOP to award credit for time served. 1 Stubbs, presumably recognizing the strength of the government's position, contends that, under United Statesv. Guevara , 941 F.2d 1299 (4th Cir. 1991), the government waived its right to appeal the district court's order. In Guevara , the defendant had entered into a plea agreement, whereby she waived her right to appeal her sentence. 2

_________________________________________________________________ 1 The defendant almost certainly is not entitled to a credit nearly as large as that computed by the district court, in any event. The Supreme Court held in Reno v. Koray , 515 U.S. 50 (1995), that a prisoner was not entitled to credit against his term of imprisonment for the time that hewas "released" on bail pursuant to the Bail Reform Act of 1984 and confined to a community treatment center. Id . at 52. Although some of the Court's reasoning was peculiar to the bail context, it noted more broadly that, credit for time spent in "official detention" under § 3585(b) is available only to those defendants who were detained in a "penal or correctional facility," § 3621(b), and who were subject to [Bureau of Prison]'s control.
Id . at 58. The Court also observed that, § 3585(b) reduces a defendant's "imprisonment" by the amount of time spent in "official detention" before his sentence, strongly suggesting that the period of presentence "detention" must be equivalent to the "imprisonment" itself. It would be anomalous to interpret § 3585(b) to require sentence credit for time spent confined in a community treatment center where the defendant is not subject to BOP's control, since Congress generally views such a restriction on liberty as part of a sentence of "probation" . . . or "supervised release," . . . rather than part of a sentence of "imprisonment."
Id . at 59 (citations omitted). 2 Stubbs' waiver of his right to appeal may have been even more comprehensive than the waiver at issue in Guevara , because it is clear that Stubbs waived not only his right to direct appeal but also his right to any postconviction relief. It is not clear whether the waiver in Guevara was limited to direct appeal.
3We held that when the government requires a defendant to waive his right to appeal (to achieve finality), the government implicitly waives its own rights to appeal: "[T]he government has added the waiver language to its standard plea agreement precisely because it preserves the finality of judgments and sentences imposed pursuant to valid pleas of guilty." [United Statesv. Wiggins , 905 F.2d51, 54 (4th Cir. 1991).] The finality of judgments and sentences imposed is no more preserved by appeals by the government than by appeals by the defendant, and it strikes us as far too one-sided to construe the plea agreement to permit an appeal by the government for a fancied mistake by the district court as here, but not to permit an appeal on similar grounds by the defendant, which Wiggins held to be precluded. That being the case, we are of the opinion that such a provision against appeals must also be enforced against the government, which must be held to have implicitly cast its lot with the district court, as the defendant explicitly did.
Guevara , 941 F.2d at 1299-1300. See also United States v. Marin ,961 F.2d 493, 495 n.2 (4th Cir. 1992) (noting in dicta that the government could not appeal a certain error because the defendant had waived his right to appeal and thus Guevaraprevented the government from appealing).
The Guevararule of reciprocity, however, does not bar the government's appeal in this case. Even when a defendant has waived his right to appeal his sentence, we have said that he is still entitled to appellate review of some sentencing errors: We agree with [defendant] that a defendant who waives his right to appeal does not subject himself to being sentenced entirely at the whim of the district court. For example, adefendant could not be said to have waived a right to appellate review of a sentence imposed in excess of the maximum penalty provided by statute or based on a constitutionally impermissible factor such as race.
Marin , 961 F.2d at 496. It was on this reasoning that, in United States v. Broughton-Jones , 71 F.3d 1143 (4th Cir. 1995), we allowed a
4defendant who had validly waived her right to appeal her sentence to challenge the legality of a restitution order on the ground that the order exceeded the district court's authority under the Victim and Witness Protection Act. Id . at 1146-47. As we explained:
Marin 's language making waivers inapplicable to appealsthat challenge sentences as "imposed in excess of the maximum penalty provided by statute" is instructive. Appealschallenging sentences of imprisonment that exceed the statutory maximum surely are such. Because a restitution order imposed when it is not authorized by the VWPA is no less "illegal" than a sentence of imprisonment that exceeds thestatutory maximum, appeals challenging the legality of restitution orders are similarly outside the scope of a defendant's otherwise valid appeal waiver.
Id . at 1147.Similarly did the district court in this case clearly exceed its authority by computing defendant's credit for time served and ordering theBOP to reduce the defendant's sentence in accordance with that calculation. Reciprocity thus requires that the government be able to appeal the legality of the district court's order, just as a defendant would be allowed -- despite a valid waiver of his right to appeal -- to challenge the legality of a district court sentencing order in similar circumstances. 3

_________________________________________________________________ 3 Defendant makes a vague argument that the government did not object to sentencing below and thus that it "waived the issues of legality and extent of the departure on appeal." Appellee's Brief at 10. However, it is clear that the sentencing colloquy to which defendant is referringoccurred at his first sentencing, before his first appeal, not at his resentencing. Id . at 9-10. Although the government did not specifically objectto the fact that the district court, rather than the Attorney General, calculated the sentence, the government clearly objected at the resentencing hearing to the court's computation of the credit to which defendant was entitled, J.A. at 65, arguing that the proper amount of time for defendant to serve "is 18 months minus whatever days the Defendant actually served in Cumberland County Jail." Id

. 5Accordingly, the judgment of the district court is again vacated and remanded for "resentencing within the applicable guideline range of 18-24 months."
VACATED AND REMANDED

6