                    FOR PUBLICATION
  UNITED STATES COURT OF APPEALS
       FOR THE NINTH CIRCUIT

PATRICK F. CHIOINO,                            No. 08-15265
               Petitioner-Appellee,
                v.                               D.C. No.
                                              CV-06-00932-MHP
SCOTT M. KERNAN, Warden,
                                                  OPINION
            Respondent-Appellant.
                                          
         Appeal from the United States District Court
           for the Northern District of California
          Marilyn H. Patel, District Judge, Presiding

                    Submitted July 16, 2009*
                    San Francisco, California

                    Filed September 21, 2009

     Before: Barry G. Silverman, Richard R. Clifton and
             Milan D. Smith, Jr., Circuit Judges.

             Opinion by Judge Milan D. Smith, Jr.




  *The panel unanimously finds this case suitable for decision without
oral argument. See Fed. R. App. P. 34(a)(2).

                               13705
                      CHIOINO v. KERNAN                   13707




                         COUNSEL

Edmund G. Brown, Jr., Attorney General for the State of Cali-
fornia, Dane R. Gillette, Chief Assistant Attorney General,
Gerard A. Engler, Senior Assistant Attorney General, Peggy
S. Ruffra, Supervising Deputy Attorney General, and Jeffrey
M. Laurence, Deputy Attorney General, San Francisco, Cali-
fornia, for the respondent-appellant.

Mary McNamara and August Gugelmann, Swanson, McNa-
mara & Haller LLP, San Francisco, California, for the
petitioner-appellee.


                          OPINION

MILAN D. SMITH, JR., Circuit Judge:

  Patrick F. Chioino (Petitioner) is a California state prisoner
who pleaded guilty to robbery and personal use of a firearm
13708                 CHIOINO v. KERNAN
with a prior strike conviction, and was sentenced by a Califor-
nia trial court judge to an upper-term sentence with enhance-
ments, totaling twenty-two years. The district court granted
Petitioner’s post-conviction petition for a writ of habeas cor-
pus, finding that Petitioner’s sentence should have been a
middle-term sentence with enhancements, totaling eighteen
years. Warden Scott M. Kernan (Respondent) appeals, argu-
ing that the district court erred in reducing Petitioner’s sen-
tence itself instead of remanding to the California trial court
for resentencing. We agree, and hold that the district judge’s
role in this habeas proceeding was solely to ensure that Peti-
tioner’s sentence was constitutionally determined, not to
resentence Petitioner.

   FACTUAL AND PROCEDURAL BACKGROUND

   In this habeas action, Petitioner challenges the sentence
imposed on him after he pleaded guilty to robbery and admit-
ted the two sentence enhancements allegations that he (1) had
one prior strike conviction and (2) had personally used a fire-
arm in the commission of the robbery. See Cal. Penal Code
§§ 211, 1170.12(c)(1), 12022.53(b). Petitioner was sentenced
to twenty-two years in state prison. The sentence consisted of
an upper-term sentence of six years for the robbery, doubled
because of the prior strike conviction, plus a consecutive ten-
year enhancement for the use of a firearm. After sentencing,
Petitioner filed a direct appeal, claiming a Blakely violation,
among other things. See Blakely v. Washington, 542 U.S. 296
(2004) (holding that the Sixth Amendment right to a jury trial
prohibits judges from enhancing criminal sentences beyond
the statutory maximum based on facts other than those
decided by the jury or admitted by the defendant). Petitioner
argued that “the trial court violated his right to have a jury
determine beyond a reasonable doubt the truth of the facts
used to support imposition of the aggravated term.” The state
appellate court determined that the trial court did not deprive
Petitioner of his constitutional right to a jury trial, and
affirmed the judgment of the trial court.
                      CHIOINO v. KERNAN                   13709
   Two years later, the United States Supreme Court decided
Cunningham v. California, 549 U.S. 270 (2007). In Cunning-
ham, the Court held that California’s determinate sentencing
law violated the Sixth Amendment because it allowed the sen-
tencing court to impose an upper-term sentence based on
aggravating facts it found to exist only by a preponderance of
the evidence. Id. at 274. The Court concluded that the middle
term is the relevant statutory maximum under California law,
and it held that judges do not have the discretion to choose to
impose an upper-term sentence unless that sentence is justi-
fied by additional facts that have been found by a jury beyond
a reasonable doubt. Id. at 288-90.

   After the Court decided Cunningham, Petitioner filed a
petition for a writ of habeas corpus in the Northern District of
California. Applying Blakely, the district court found a consti-
tutional error in Petitioner’s sentencing, because the “upper
term base sentence he received was not permitted based on
[his three] admissions” contained in the record. The district
court also found that this error was not harmless, as “the
record here simply does not have any evidence, let alone
uncontroverted and overwhelming evidence, to support the
imposition of the upper term on the robbery.”

   The district court granted the writ of habeas corpus, deter-
mining that Petitioner’s total sentence “should be” eighteen
years (based on the middle-term sentence of four years)
instead of twenty-two years (based on the upper-term sen-
tence of six years). The district court also ordered that “the
State of California shall cause Chioino’s sentence in Monte-
rey County Superior Court Case No. SS022872 to be fixed in
accordance with this order. This court leaves it to state offi-
cials to determine the appropriate procedure to fix the uncon-
stitutional sentence, i.e., whether state law requires that
Chioino be resentenced or require[s] an amended abstract of
judgment to correct the sentence or required correction in
another way.”
13710                      CHIOINO v. KERNAN
   In response, Respondent filed a motion under Federal Rule
of Civil Procedure 59(e) to alter or amend the judgment.
Respondent argued that the district court committed clear
error in “fashion[ing] a new sentence without remanding to
the trial court for a new sentencing hearing.” Respondent
argued that the appropriate remedy was to direct the state to
hold a new sentencing hearing pursuant to California’s
reformed sentencing system, as set forth in People v. Sando-
val, 41 Cal. 4th 825 (2007).

   The district court denied Respondent’s Rule 59(e) motion,
holding that Sandoval “does not lead to the conclusion that
this court committed clear error in the remedy it chose upon
finding a Sixth Amendment violation in the sentence” and
that “serious ex post facto concerns are raised in re-sentencing
under a newly reformed sentencing scheme.” Respondent now
appeals, claiming that the district court erred in ordering Peti-
tioner’s upper-term sentence reduced to a middle-term sen-
tence without providing Respondent the option of holding a
new sentencing hearing.1

   We have jurisdiction under 28 U.S.C. §§ 2253(a) & 2254.
A district court’s ruling on the appropriate remedy for a con-
stitutional violation on a habeas petition is reviewed for abuse
of discretion. Riggs v. Fairman, 399 F.3d 1179, 1181 (9th Cir.
2005).
  1
    Respondent also argues that the district court erred by retroactively
applying Cunningham v. California, 549 U.S. 270 (2007). We have since
held that where a federal habeas petitioner’s conviction became final
between Blakely and Cunningham, the rule in Cunningham should be
retroactively applied under Teague v. Lane, 489 U.S. 288 (1989). Butler
v. Curry, 528 F.3d 624, 639 (9th Cir. 2008). Accordingly, Cunningham‘s
retroactivity is settled law in this circuit, and thus Respondent’s additional
argument fails.
                          CHIOINO v. KERNAN                        13711
                           DISCUSSION

   [1] Respondent argues that the district court erred by order-
ing that Petitioner’s six-year upper-term sentence be reduced
to a four-year middle-term sentence. The Supreme Court has
instructed that “[f]ederal habeas corpus practice, as reflected
by the decisions of this Court, indicates that a court has broad
discretion in conditioning a judgment granting habeas relief.
Federal courts are authorized, under 28 U.S.C. § 2243, to dis-
pose of habeas corpus matters ‘as law and justice require.’ ”
Hilton v. Braunskill, 481 U.S. 770, 775 (1987). Habeas reme-
dies “ ‘should put the defendant back in the position he would
have been in if the Sixth Amendment violation never
occurred.’ ” Nunes v. Mueller, 350 F.3d 1045, 1057 (9th Cir.
2003) (quoting United States v. Blaylock, 20 F.3d 1458, 1468
(9th Cir. 1994)). “[U]nless the district court abused its discre-
tion in fashioning a remedy, that remedy must stand.” Riggs
v. Fairman, 399 F.3d at 1184. However, “the fact that the writ
has been called an ‘equitable’ remedy does not authorize a
court to ignore . . . statutes, rules, and precedents . . . . Rather,
courts of equity must be governed by rules and precedents no
less than the courts of law.” Lonchar v. Thomas, 517 U.S.
314, 323 (1996) (citations and internal quotation marks omit-
ted).

   Respondent argues that the district court abused its discre-
tion because its reduction of Petitioner’s sentence rested “on
an inaccurate view of California law.” The California
Supreme Court’s opinion in People v. Sandoval delineated the
procedure for cases remanded to a state trial court for resen-
tencing because of a Cunningham violation. Sandoval, 41 Cal.
4th at 845-46 (noting that the California Supreme Court has
“the responsibility and authority to fashion a constitutional
procedure for resentencing in cases in which Cunningham
requires a reversal of an upper term sentence”).2 The court
  2
   As the district court recognized, Sandoval involved a case on direct
appeal and did not explicitly discuss the appropriate procedure for habeas
corpus petitions.
13712                 CHIOINO v. KERNAN
also held that resentencing following a discretionary resen-
tencing scheme is preferable to the alternative of “maintaining
the requirement that the middle term be imposed in the
absence of aggravating or mitigating factors but permitting a
jury trial on aggravating circumstances.” Id. at 848. Sandoval
eliminated the presumption for a middle-term sentence and
gave the trial court the discretion to impose the upper term on
remand without a jury trial on factual findings. Id. at 843-45.

   [2] When it denied Respondent’s Rule 59(e) motion to
amend, the district court worried that applying Sandoval and
remanding for resentencing under the newly formed discre-
tionary scheme would raise ex post facto concerns. Those
concerns were unwarranted. Sandoval itself held that resen-
tencing under the newly reformed scheme was not controlled
by the test set forth in Miller v. Florida, 482 U.S. 423 (1987),
“because the prohibition on ex post facto laws applies only to
statutory enactments, not to judicial decisions.” Sandoval, 41
Cal. 4th at 855. We have also determined that no ex post facto
concerns are generated by remanding for resentencing for a
Cunningham violation if the sentencing court follows the Cal-
ifornia Supreme Court’s instructions in Sandoval. Butler v.
Curry explained:

    In People v. Sandoval, 41 Cal. 4th 825 (2007), the
    California Supreme Court addressed the appropriate
    procedure for resentencing individuals who had been
    sentenced under the prior version of the law, and
    concluded that it need not decide whether the 2007
    amendments to the penal code were retroactive,
    because it could simply judicially “reform” the pre-
    vious law to require sentencing in accordance with
    the principles of the 2007 amendments. Id. at 849.

    [Petitioner] argues that applying this judicial refor-
    mation of the law violates the ex post facto princi-
    ples contained in the Due Process Clause of the
    Fourteenth Amendment. See Bouie v. City of Colum-
                       CHIOINO v. KERNAN                   13713
    bia, 378 U.S. 347, 352-55 (1964). As [Petitioner]
    acknowledges, however, this question is controlled
    by United States v. Dupas, 419 F.3d 916 (9th Cir.
    2005), in which we held that retroactive application
    of the remedial opinion in Booker does not violate
    the Due Process Clause. Id. at 921.

Butler, 528 F.3d at 652 n.20. Thus, the district court’s order
denying the motion to amend was based on an inaccurate
view of both California and Ninth Circuit law. Remanding to
the state trial court for resentencing under the Sandoval proce-
dure raises no ex post facto concerns.

   [3] Respondent also argues that because Cunningham set
out the right to a particular sentencing procedure rather than
a substantive right to a particular sentence, the appropriate
remedy for a Cunningham violation is to remand for a new
sentencing hearing that utilizes a constitutional procedure. We
agree. As the Supreme Court explained in United States v.
Morrison, 449 U.S. 361 (1981), habeas remedies “should not
unnecessarily infringe on competing interests” such as a
state’s “interest in the administration of criminal justice.” Id.
at 364. California has clarified what it believes to be the
proper procedure for resentencing due to a Cunningham viola-
tion through both legislative and judicial action. See 2007 Cal.
Stats., ch. 3, § 2 (West) (amending section 1170(b) of the Cal-
ifornia Penal Code to comply with the constitutional require-
ments of Cunningham); People v. Sandoval, 41 Cal. 4th at
843-45 (reforming prior statute to conform to the newly
amended statute for all Cunningham resentencings). Here, the
district court’s responsibility was to ensure that Petitioner was
sentenced utilizing a constitutionally sound procedure, and it
is the state court’s responsibility to determine the procedure
that satisfies the Sixth Amendment and Cunningham.

   [4] Once it found a Cunningham violation, the district court
should have remanded to the state trial court for resentencing
instead of ordering the state trial court to reduce the sentence
13714                 CHIOINO v. KERNAN
in accordance with the district court’s order. Even though the
district court here believed there were no aggravating factors
in the record that could have supported the upper-term sen-
tence, a remand to the state trial court for resentencing under
the procedures delineated in Sandoval was still required. The
district court abused its discretion by resentencing Petitioner
itself instead of remanding to the state trial court to utilize
California’s reformed system.

                      CONCLUSION

   The district court is directed to amend its order to require
that the matter be remanded to the state trial court for resen-
tencing.

  REVERSED and REMANDED.
