Florencio Dominguez v. Scott Kernan , 906 F.3d 1127 ( 2018 )


Menu:
  •                      FOR PUBLICATION
    UNITED STATES COURT OF APPEALS
    FOR THE NINTH CIRCUIT
    FLORENCIO JOSE DOMINGUEZ,                          No. 18-55209
    Petitioner-Appellant,
    D.C. No.
    v.                           3:14-cv-02890-
    BAS-RBB
    SCOTT KERNAN, Secretary of the
    California Department of
    Corrections and Rehabilitation,                      OPINION
    Respondent-Appellee.
    Appeal from the United States District Court
    for the Southern District of California
    Cynthia A. Bashant, District Judge, Presiding
    Argued and Submitted June 8, 2018
    Pasadena, California
    Filed October 23, 2018
    Before: Raymond C. Fisher and Morgan Christen, Circuit
    Judges, and Edward F. Shea, District Judge.*
    Opinion by Judge Fisher
    *
    The Honorable Edward F. Shea, United States District Judge for the
    Eastern District of Washington, sitting by designation.
    2                     DOMINGUEZ V. KERNAN
    SUMMARY**
    Habeas Corpus
    The panel vacated the district court’s dismissal of
    Florencio Dominguez’s 
    28 U.S.C. § 2254
     habeas corpus
    petition asserting that the state of California’s second
    prosecution of him violates the Double Jeopardy Clause, and
    remanded.
    Dominguez was charged with murder. After his trial
    ended in a hung jury, the trial court dismissed the case and
    the state filed a new complaint, charging Dominguez with
    murder and conspiracy to commit murder. Dominguez filed
    a demurrer, arguing the second prosecution violated his rights
    under the Double Jeopardy Clause and California law, but the
    trial court overruled his demurrer, and Dominguez was tried
    and convicted. Dominguez then asserted his double jeopardy
    claim in the § 2254 petition. While that petition was pending,
    the state trial court vacated Dominguez’s convictions under
    Brady v. Maryland, 
    373 U.S. 83
     (1963), and the state has
    elected to retry him on the charge of conspiracy to commit
    murder. The state placed Dominguez in pretrial custody,
    where he remains. Citing the state court’s decision vacating
    the earlier convictions, the district court dismissed
    Dominguez’s federal habeas petition as moot.
    The panel held that Dominguez’s petition is not moot.
    The panel explained that the petition continues to present a
    live controversy because he remains in custody, continues to
    **
    This summary constitutes no part of the opinion of the court. It has
    been prepared by court staff for the convenience of the reader.
    DOMINGUEZ V. KERNAN                        3
    claim he is in custody in violation of the Constitution of the
    United States, and continues to present precisely the same
    legal claim that he presented when his petition was filed –
    that the state’s second prosecution of him, which remains
    ongoing, violates his federal constitutional right not to be
    twice placed in jeopardy for the same offense.
    The panel also held that because Dominguez’s detention
    is no longer attributable to a state court judgment, proceeding
    under § 2254 is no longer appropriate, and he is free to seek
    habeas relief under 
    28 U.S.C. § 2241
    (a) and (c)(3) instead.
    The panel held that, to proceed under § 2241, Dominguez
    is not required to dismiss his § 2254 petition and file a new
    petition under § 2241. The panel held that just as a court may
    convert a § 2241 petition to a § 2254 petition when a pretrial
    detainee is convicted while a petition is pending, a court has
    the authority to convert a § 2254 petition into a § 2241
    petition when, as here, a petitioner’s convictions are vacated
    during the pendency of the petition and the petitioner has
    become a pretrial detainee. The panel instructed that the
    district court on remand shall, either upon Dominguez’s
    request or at the court’s initiation but with Dominguez’s
    consent, convert the petition to one arising under § 2241. The
    panel instructed that if Dominguez elects not to convert the
    petition, the district court shall dismiss the petition without
    prejudice.
    4                 DOMINGUEZ V. KERNAN
    COUNSEL
    Matthew J. Speredelozzi (argued) and Patrick Morgan Ford,
    San Diego, California, for Petitioner-Appellant.
    Kevin Vienna (argued), Deputy Attorney General; Daniel
    Rogers, Supervising Deputy Attorney General; Julie L.
    Garland, Senior Assistant Attorney General; Xavier Becerra,
    Attorney General; Office of the Attorney General, San Diego,
    California; for Respondent-Appellee.
    OPINION
    FISHER, Circuit Judge:
    Florencio Dominguez was charged with murder. After
    his trial ended in a hung jury, the trial court dismissed the
    case under California Penal Code § 1385. The state filed a
    new complaint, charging Dominguez with murder and
    conspiracy to commit murder. Dominguez filed a demurrer,
    arguing the second prosecution violated his rights under the
    Double Jeopardy Clause and California law, but the trial court
    overruled his demurrer, and Dominguez was tried and
    convicted. Dominguez then asserted his double jeopardy
    claim in a federal habeas petition under 
    28 U.S.C. § 2254
    .
    While that petition was pending, the state trial court vacated
    Dominguez’s convictions under Brady v. Maryland, 
    373 U.S. 83
     (1963), and the state has elected to retry him on the charge
    of conspiracy to commit murder. The state placed
    Dominguez in pretrial custody, where he remains. Citing the
    state court’s decision vacating the earlier convictions, the
    district court dismissed Dominguez’s federal habeas petition
    as moot. Dominguez appeals.
    DOMINGUEZ V. KERNAN                        5
    We hold Dominguez’s petition is not moot. It continues
    to present a live controversy because he remains in custody,
    continues to claim he is in custody in violation of the
    Constitution of the United States and continues to present
    precisely the same legal claim that he presented when his
    petition was filed – that the state’s second prosecution of him,
    which remains ongoing, violates his federal constitutional
    right not to be twice placed in jeopardy for the same offense.
    We hold, however, that Dominguez is no longer required
    to proceed under § 2254. Section 2254 limits the general
    grant of habeas authority under 
    28 U.S.C. § 2241
     by placing
    additional obstacles in the path of a person seeking habeas
    relief when he is “in custody pursuant to the judgment of a
    State court.” 
    28 U.S.C. § 2254
    (a). Where a petitioner is not
    challenging custody attributable to a state court judgment, his
    custody does not bear a presumption of validity.
    Section 2254 therefore does not apply, and he is free to seek
    habeas relief under § 2241(a) and (c)(3) instead.
    Finally, we hold that, to proceed under § 2241,
    Dominguez is not required to dismiss his § 2254 petition and
    file a new petition under § 2241. Just as a court may convert
    a § 2241 petition to a § 2254 petition when a pretrial detainee
    is convicted while a petition is pending, we hold that a court
    has the authority to convert a § 2254 petition into a § 2241
    petition when a petitioner’s convictions are vacated during
    the pendency of the petition and the petitioner has become a
    pretrial detainee.
    We vacate the judgment and remand for proceedings
    consistent with this opinion.
    6                     DOMINGUEZ V. KERNAN
    BACKGROUND
    Dominguez was charged with murder in 2010 (San Diego
    County Superior Court No. SCD225579). His trial resulted
    in a hung jury, and the state trial court dismissed the case
    under California Penal Code § 1385.1 The state refiled the
    criminal complaint (San Diego County Superior Court No.
    SCD230596), charging Dominguez again with murder and
    adding a new charge for conspiracy to commit murder. See
    
    Cal. Penal Code §§ 182
    (a)(1), 187(a). Dominguez filed a
    demurrer, arguing the second prosecution was barred by
    double jeopardy and California Penal Code § 654.2 He
    1
    See 
    Cal. Penal Code § 1385
    (a) (“The judge or magistrate may, either
    of his or her own motion or upon the application of the prosecuting
    attorney, and in furtherance of justice, order an action to be dismissed.
    The reasons for the dismissal shall be stated orally on the record. The
    court shall also set forth the reasons in an order entered upon the minutes
    if requested by either party or in any case in which the proceedings are not
    being recorded electronically or reported by a court reporter. A dismissal
    shall not be made for any cause that would be ground of demurrer to the
    accusatory pleading.”).
    The trial court dismissed the case on the ground that the prosecution
    had failed to establish Dominguez had pulled the trigger: “There may
    come a time in the future when someone else comes forward to say [it
    was] either the defendant or someone else. Because the defendant, if he
    didn’t pull the trigger, he knows who did. He’s standing right there. It
    may be somebody else, but based on the current state of the evidence, that
    can’t be proven. And so at this point the matter is dismissed without
    prejudice.”
    2
    See 
    Cal. Penal Code § 654
    (a) (“An act or omission that is punishable
    in different ways by different provisions of law shall be punished under
    the provision that provides for the longest potential term of imprisonment,
    but in no case shall the act or omission be punished under more than one
    provision. An acquittal or conviction and sentence under any one bars a
    prosecution for the same act or omission under any other.”).
    DOMINGUEZ V. KERNAN                                 7
    contended the state trial court’s dismissal under § 1385
    amounted to a finding of insufficient evidence that operated
    as an acquittal for purposes of double jeopardy. See Bravo-
    Fernandez v. United States, 
    137 S. Ct. 352
    , 364 (2016) (“For
    double jeopardy purposes, a court’s evaluation of the
    evidence as insufficient to convict is equivalent to an
    acquittal and therefore bars a second prosecution for the same
    offense.”). The state trial court overruled the demurrer.
    The second prosecution proceeded to trial, and
    Dominguez was convicted on both charges. Dominguez
    appealed the convictions, arguing again that the second
    prosecution violated double jeopardy. In a reasoned decision,
    the California Court of Appeal denied relief, disagreeing with
    Dominguez’s contention that the 2010 dismissal constituted
    a finding of insufficient evidence. See People v. Dominguez,
    No. D060019, 
    2013 WL 3362112
    , at *8–10 (Cal. Ct. App.
    July 5, 2013). The California Supreme Court denied review.
    Dominguez then filed a federal habeas petition under
    
    28 U.S.C. § 2254
    , renewing his double jeopardy challenge to
    the second prosecution. Dominguez argued “the second trial
    was barred under the Fifth Amendment” and asked the
    district court to “remand the case back to trial court directing
    it to grant [his] demurrer on Double Jeopardy grounds.” A
    federal magistrate judge recommended the district court grant
    the writ, agreeing with Dominguez that the 2010 dismissal
    operated as an acquittal, and concluding that the California
    Court of Appeal’s decision to the contrary was both an
    “The Double Jeopardy Clause of the Fifth Amendment, applicable to
    the States through the Fourteenth, provides that no person shall ‘be subject
    for the same offence to be twice put in jeopardy of life or limb.’” Brown
    v. Ohio, 
    432 U.S. 161
    , 164 (1977) (quoting U.S. Const. amend. V).
    8                     DOMINGUEZ V. KERNAN
    unreasonable application of Supreme Court precedent under
    § 2254(d)(1) and based on an unreasonable determination of
    the facts under § 2254(d)(2).
    Before the district court could rule on the magistrate
    judge’s recommendation, a state trial court granted
    Dominguez post-conviction relief on an independent ground,
    vacating his murder and conspiracy convictions under Brady
    v. Maryland, 
    373 U.S. 83
     (1963).3 The trial court vacated the
    judgment and ordered the state to either retry Dominguez or
    release him. The state has elected to retry Dominguez, but it
    is proceeding solely on the conspiracy charge. Dominguez
    remains in state custody pending trial.4
    When the district court learned of the state court’s
    decision vacating the convictions, it ordered the parties “to
    show cause as to why [the federal petition] should not be
    dismissed as moot.” The state urged the court to dismiss the
    petition, arguing that, “[b]ecause Dominguez is no longer in
    custody for the murder conviction, he received the relief he
    sought in this Court.” Dominguez opposed dismissal, arguing
    his petition continued to present a live controversy because he
    “remains in custody facing retrial” and the retrial would
    “violate double jeopardy on the exact same grounds
    Dominguez claims in this [petition].”
    3
    In Brady, the Supreme Court held that a state violates a defendant’s
    right to due process when it suppresses evidence favorable to an accused
    that is material to guilt or punishment. See Cone v. Bell, 
    556 U.S. 449
    ,
    451 (2009).
    4
    Unlike Dominguez’s first and second trials, which occurred in two
    distinct cases, his second trial and his pending third trial are part of a
    single prosecution in a single case, San Diego County Superior Court No.
    SCD230596.
    DOMINGUEZ V. KERNAN                        9
    In a January 2018 order, the district court agreed with the
    state and concluded Dominguez’s petition was moot:
    Dominguez filed this petition under
    
    28 U.S.C. § 2254
     to challenge his conviction
    for first-degree murder and conspiracy to
    commit murder. But the state court has since
    vacated this conviction. In doing so, it
    extinguished Dominguez’s two claims under
    § 2254. His claim that . . . his second
    prosecution violated the Double Jeopardy
    Clause . . . does not present a live controversy.
    He is no longer in custody pursuant to the
    conviction procured by the second
    prosecution. Moreover, unlike cases where
    petitioners have completed their sentences but
    are still permitted to challenge their
    convictions because the convictions cause
    collateral consequences, there is no conviction
    here for Dominguez to seek to set aside. At
    this point, opining on the constitutional
    condition of Dominguez’s second prosecution
    would be advisory. Therefore, the two claims
    raised in Dominguez’s § 2254 petition are
    moot.
    The court also declined to treat Dominguez’s petition as a
    “pre-trial custody petition” under 
    28 U.S.C. § 2241
    ,
    explaining that doing so would require the court to address
    three undeveloped issues: Younger abstention; exhaustion;
    10                     DOMINGUEZ V. KERNAN
    and the merits of Dominguez’s double jeopardy claim.5 The
    court dismissed Dominguez’s petition as moot and declined
    to issue a certificate of appealability.
    Dominguez timely appealed, and we issued a certificate
    of appealability “with respect to . . . whether the district court
    erred by dismissing the petition as moot, including whether
    the petition should be construed as a petition under 
    28 U.S.C. § 2241
    .”
    5
    Younger v. Harris, 
    401 U.S. 37
     (1971), requires federal courts to
    abstain from interfering with pending state criminal proceedings. A
    colorable claim that a state prosecution will violate the Double Jeopardy
    Clause, however, presents an exception to Younger: “Because full
    vindication of the right necessarily requires intervention before trial,
    federal courts will entertain pretrial habeas petitions that raise a colorable
    claim of double jeopardy.” Mannes v. Gillespie, 
    967 F.2d 1310
    , 1312 (9th
    Cir. 1992). Because Dominguez has presented a colorable double
    jeopardy claim, we hold Younger abstention does not apply.
    With respect to exhaustion, there is no dispute that Dominguez
    presented a double jeopardy challenge to his second prosecution at all
    three levels of the California courts, but the state maintains Dominguez
    challenged solely his re-prosecution for murder, not his prosecution for
    conspiracy to commit murder, the sole remaining charge. Dominguez
    contends he adequately exhausted this claim.
    As to the merits, the parties disagree over whether Dominguez’s
    claimed acquittal on the murder charge precludes his re-prosecution on the
    conspiracy charge. Dominguez argues the collateral estoppel aspects of
    double jeopardy apply, see Ashe v. Swenson, 
    397 U.S. 436
     (1970), and
    hence that the conspiracy prosecution too is constitutionally barred.
    DOMINGUEZ V. KERNAN                                11
    STANDARD OF REVIEW
    “We review de novo the district court’s dismissal of a
    habeas petition on the ground of mootness.” Zegarra-Gomez
    v. INS, 
    314 F.3d 1124
    , 1126 (9th Cir. 2003).
    DISCUSSION
    A. Dominguez’s Petition Is Not Moot
    “[A] case ‘becomes moot only when it is impossible for
    a court to grant any effectual relief whatever to the prevailing
    party.’” Chafin v. Chafin, 
    568 U.S. 165
    , 172 (2013) (quoting
    Knox v. Serv. Emps. Int’l Union, Local 1000, 
    567 U.S. 298
    ,
    307 (2012)). “As long as the parties have a concrete interest,
    however small, in the outcome of the litigation, the case is not
    moot.” 
    Id.
     (quoting Knox, 
    567 U.S. at
    307–08).
    Here, Dominguez’s petition continues to present a live
    controversy, and it remains possible for the district court to
    grant him effectual relief.6 In his federal habeas petition,
    6
    “Once the petitioner sustains his burden of demonstrating
    entitlement to federal habeas relief, the district court has wide discretion
    in choosing the appropriate remedy.” Brian R. Means, Federal Habeas
    Manual § 13:5 (2018); see also 
    28 U.S.C. § 2243
     (“The court shall
    summarily hear and determine the facts, and dispose of the matter as law
    and justice require.”); Hilton v. Braunskill, 
    481 U.S. 770
    , 775 (1987)
    (“Federal 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.”); 2 Randy Hertz & James S. Liebman,
    Federal Habeas Corpus Practice and Procedure § 33.1 (7th ed. 2017)
    (“In general . . . , in cases in which a petitioner has established a right to
    relief from some unlawful aspect of ‘custody’ in the broad sense, modern
    federal habeas corpus practice has moved towards full realization of the
    12                   DOMINGUEZ V. KERNAN
    Dominguez argues his second prosecution is barred by double
    jeopardy and asks the district court to “remand the case back
    to trial court directing it to grant [his] demurrer on Double
    Jeopardy grounds.” Dominguez’s second prosecution is
    ongoing, and he continues to argue his second prosecution
    violates the Double Jeopardy Clause because his first trial
    ended in an acquittal. Were the district court to grant
    Dominguez the relief he seeks, he would no longer be subject
    to prosecution in state court.
    The district court concluded Dominguez’s petition was
    moot, but it did so because it viewed the petition as
    challenging only “his conviction for first-degree murder and
    conspiracy to commit murder.” The court reasoned,
    “Because his conviction has been vacated, his two claims
    targeting it under § 2254 are moot.” To the extent
    Dominguez’s petition challenges those convictions, the
    petition is indeed moot, because those convictions have been
    vacated, and no collateral consequences flow from them. See
    Spencer v. Kemna, 
    523 U.S. 1
    , 7–8 (1998); Carafas v.
    LaVallee, 
    391 U.S. 234
    , 237–38 (1968).
    The district court erred, however, by construing
    Dominguez’s petition as a challenge solely – or even
    primarily – to his convictions rather than to his second
    prosecution generally. Properly understood, Dominguez’s
    petition continues to present a live controversy because he is
    still in custody, he continues to challenge his prosecution on
    the same ground and his prosecution is ongoing. The vacatur
    statute’s ‘law and justice’ command and has recognized a wide variety of
    appropriate remedial orders.”).
    DOMINGUEZ V. KERNAN                                13
    of Dominguez’s convictions changes the procedural posture
    of the case but does not render the petition moot.7
    In Shute v. Texas, 
    117 F.3d 233
    , 236 (5th Cir. 1997), for
    example, the petitioner filed a federal petition challenging his
    second indictment on double jeopardy grounds. While his
    petition was pending, the second indictment was dismissed
    for technical reasons, and the state secured a third indictment.
    See 
    id.
     The Fifth Circuit rejected the suggestion that
    dismissal of the second indictment rendered the petition
    moot:
    In federal court, Shute sought a writ of
    habeas corpus on double jeopardy grounds.
    This entailed two requests: (1) an order of
    7
    Dominguez’s double jeopardy rights are not diminished by the fact
    that he is now a pretrial detainee rather than a convicted prisoner. As the
    Supreme Court has long recognized, “the Double Jeopardy Clause protects
    an individual against more than being subjected to double punishments.
    It is a guarantee against being twice put to trial for the same offense.”
    Abney v. United States, 
    431 U.S. 651
    , 660–61 (1977). If this right is not
    vindicated before trial, a vitally important aspect of the guarantee is
    forever lost. As the Court explained in Abney, because it “focus[es] on the
    ‘risk’ of conviction, the guarantee against double jeopardy assures an
    individual that, among other things, he will not be forced . . . to endure the
    personal strain, public embarrassment, and expense of a criminal trial
    more than once for the same offense.” 
    Id. at 661
    . “Obviously, these
    aspects of the guarantee’s protections would be lost if the accused were
    forced to ‘run the gauntlet’ a second time before [the prosecution could be
    challenged]; even if the accused is acquitted, or, if convicted, has his
    conviction ultimately reversed on double jeopardy grounds, he has still
    been forced to endure a trial that the Double Jeopardy Clause was
    designed to prohibit.” 
    Id. at 662
    . Here, Dominguez is a pretrial detainee,
    facing trial on what may amount to the same charges the state pursued in
    his first two trials. His double jeopardy claim therefore is not moot.
    14                   DOMINGUEZ V. KERNAN
    release from custody and (2) an injunction
    against state prosecution. . . .
    ....
    Once the state secured the Third
    Indictment, both forms of requested relief
    were live again. Shute still wanted release
    from custody and still wanted an injunction
    against prosecution. Although any state
    prosecution would be under a different
    indictment from the one attacked before the
    district court, this cannot make a difference.
    If the district court had granted the injunction
    against state prosecution under the Second
    Indictment, prosecution under the Third
    Indictment would be barred as well.
    Otherwise, the state always could defeat a
    federal double jeopardy habeas ruling by
    dismissing an indictment and immediately
    securing an identical one.
    Shute’s request for . . . relief from custody
    . . . remains a live controversy as long as he is
    imprisoned.
    Id. at 237.
    Similarly, in Warnick v. Booher, 
    425 F.3d 842
    , 843 (10th
    Cir. 2005), the petitioner filed a federal habeas petition
    challenging the loss of 155 good-time credits as a violation of
    double jeopardy. While the petition was pending, the prison
    restored the 155 credits but subtracted another 53 credits.
    The Tenth Circuit held the claim was moot as to the
    DOMINGUEZ V. KERNAN                                15
    155 credits but that the case continued to present a live
    controversy as to the loss of 53 credits, noting that the
    petitioner’s objection to the loss of 53 credits was based on
    the same theory that “the subtraction of any credits after his
    rebill date violates double-jeopardy principles.” 
    Id. at 846
    .
    The petitioner therefore was not required to pursue a new
    habeas petition. See 
    id.
    We hold Dominguez’s § 2254 petition is not moot. The
    district court erred by ruling otherwise.8
    B. Dominguez Is No Longer Required to Proceed Under
    § 2254
    Apart from the issue of mootness, we granted a certificate
    of appealability on “whether the petition should be construed
    as a petition under 
    28 U.S.C. § 2241
    .” We hold that it should
    be.
    Section 2241 establishes the general authority of the
    federal courts to issue habeas relief. It provides that “[w]rits
    of habeas corpus may be granted by the Supreme Court, any
    justice thereof, the district courts and any circuit judge within
    their respective jurisdictions,” 
    28 U.S.C. § 2241
    (a), and it
    8
    A leading habeas treatise explains that double jeopardy claims “are
    not mooted by conviction because they challenge not only the legality of
    the pretrial detention but also the legality of the postconviction detention.”
    1 Hertz & Liebman, supra, § 8.2 n.13. The same principle applies here,
    although in the opposite direction: Dominguez’s double jeopardy
    continues to present a live controversy because it challenges not only the
    legality of his post-conviction detention but also the legality of the second
    prosecution generally, including, therefore, the legality of his pretrial
    detention.
    16                 DOMINGUEZ V. KERNAN
    specifies five circumstances in which a petitioner may be
    granted relief:
    (1) He is in custody under or by color of the
    authority of the United States or is committed
    for trial before some court thereof; or
    (2) He is in custody for an act done or omitted
    in pursuance of an Act of Congress, or an
    order, process, judgment or decree of a court
    or judge of the United States; or
    (3) He is in custody in violation of the
    Constitution or laws or treaties of the United
    States; or
    (4) He, being a citizen of a foreign state and
    domiciled therein is in custody for an act done
    or omitted under any alleged right, title,
    authority, privilege, protection, or exemption
    claimed under the commission, order or
    sanction of any foreign state, or under color
    thereof, the validity and effect of which
    depend upon the law of nations; or
    (5) It is necessary to bring him into court to
    testify or for trial.
    Id. § 2241(c) (emphasis added).
    Section 2254, in turn, states:
    The Supreme Court, a Justice thereof, a circuit
    judge, or a district court shall entertain an
    DOMINGUEZ V. KERNAN                       17
    application for a writ of habeas corpus in
    behalf of a person in custody pursuant to the
    judgment of a State court only on the ground
    that he is in custody in violation of the
    Constitution or laws or treaties of the United
    States.
    Id. § 2254(a).
    Section 2254 has been understood as limiting the
    authority granted by § 2241 rather than supplementing it. As
    the Supreme Court has explained, “[o]ur authority to grant
    habeas relief to state prisoners is limited by § 2254, which
    specifies the conditions under which such relief may be
    granted to ‘a person in custody pursuant to the judgment of a
    State court.’” Felker v. Turpin, 
    518 U.S. 651
    , 662 (1996)
    (quoting 
    28 U.S.C. § 2254
    (a)); see also White v. Lambert,
    
    370 F.3d 1002
    , 1006 (9th Cir. 2004) (“In contrast to section
    2255, section 2254 does not create an alternative to the
    habeas corpus remedy provided in section 2241; rather, it
    imposes limitations on this remedy.” (quoting Eric Johnson,
    An Analysis of the Antiterrorism and Effective Death Penalty
    Act in Relation to State Administrative Orders: the State
    Court Judgment as the Genesis of Custody, 29 New Eng. J.
    on Crim. & Civ. Confinement 153, 168 (2003))), overruled
    on other grounds by Hayward v. Marshall, 
    603 F.3d 546
     (9th
    Cir. 2010) (en banc); Greenawalt v. Stewart, 
    105 F.3d 1287
    ,
    1287 (9th Cir. 1997) (“The Supreme Court has instructed us
    that the authority of the federal courts to grant habeas relief
    to state prisoners under § 2241 is limited by 
    28 U.S.C. § 2254
    .”).
    Thus, “a prisoner proceeding under § 2254 is subject to
    obstacles a prisoner proceeding under § 2241 is not.” Bryan
    18                  DOMINGUEZ V. KERNAN
    R. Means, Postconviction Remedies § 5:2 (2018). Section
    2254, for example, provides that “an application for a writ of
    habeas corpus in behalf of a person in custody pursuant to the
    judgment of a State court only on the ground that he is in
    custody in violation of the Constitution or laws or treaties of
    the United States.” 
    28 U.S.C. § 2254
    (a) (emphasis added).
    It further provides that “[a]n application for a writ of habeas
    corpus on behalf of a person in custody pursuant to the
    judgment of a State court shall not be granted unless it
    appears that . . . the applicant has exhausted the remedies
    available in the courts of the State.” 
    Id.
     § 2254(b)(1).9
    Section 2244, moreover, provides that “[a] 1-year period of
    limitation shall apply to an application for a writ of habeas
    corpus by a person in custody pursuant to the judgment of a
    State court,” id. § 2244(d)(1), and it places a limit on “second
    or successive” § 2254 petitions, see id. § 2244(b). Perhaps
    most significantly, the Antiterrorism and Effective Death
    Penalty Act of 1996 (AEDPA), provides that “[a]n
    application for a writ of habeas corpus on behalf of a person
    in custody pursuant to the judgment of a State court” may not
    be granted unless the state court’s adjudication of that claim
    “resulted in a decision that was contrary to, or involved an
    unreasonable application of,” Supreme Court precedent or
    “resulted in a decision that was based on an unreasonable
    determination of the facts.” Id. § 2254(d).
    Congress placed these additional limits on petitions under
    § 2254 because a state court judgment “carries a heightened
    presumption of legitimacy.” Johnson, supra, at 171–72.
    Because a state court judgment “is presumptively legitimate,”
    9
    Even in cases brought under § 2241, exhaustion is required. See
    Laing v. Ashcroft, 
    370 F.3d 994
    , 997 (9th Cir. 2004). This exhaustion
    requirement, however, is judicially created, not statutory.
    DOMINGUEZ V. KERNAN                            19
    moreover, so too is custody attributable to that judgment. See
    id. at 172. Congress therefore concluded “it was acceptable
    to place obstacles in the paths of prisoners” who are
    challenging custody attributable to a state court judgment.
    See id.
    Because § 2254 limits the general grant of habeas relief
    under § 2241, it “is the exclusive vehicle for a habeas petition
    by a state prisoner in custody pursuant to a state court
    judgment, even when the petitioner is not challenging his
    underlying state court conviction.” White, 
    370 F.3d at
    1009–10. “By contrast, the general grant of habeas authority
    in § 2241 is available for challenges by a state prisoner who
    is not in custody pursuant to a state court judgment – for
    example, a defendant in pre-trial detention or awaiting
    extradition.” Id. at 1006.10
    Here, Dominguez properly brought his double jeopardy
    claim under § 2254 when he filed his petition. At that time,
    he was in custody pursuant to a state court judgment and was
    challenging his custody attributable to that judgment. We are
    persuaded, however, that Dominguez is no longer required to
    proceed under § 2254. We reach this conclusion for two
    independent yet related reasons.
    First, as noted, a petitioner who is “in custody pursuant to
    the judgment of a State court” is subject to additional
    limitations because the judgment, and the custody attributable
    to that judgment, carry a heightened presumption of
    legitimacy. Here, Dominguez’s judgment has been vacated.
    10
    A pretrial double jeopardy challenge, for instance, “is properly
    brought under § 2241.” Stow v. Murashige, 
    389 F.3d 880
    , 886 (9th Cir.
    2004).
    20                 DOMINGUEZ V. KERNAN
    He is not in custody pursuant to a judgment of a state court.
    He is a pretrial detainee, and his detention bears no
    presumption of validity. He should, therefore, be placed on
    an equal footing with other pretrial detainees, who may avail
    themselves of habeas relief under § 2241(a) and (c)(3)
    without regard to the additional requirements imposed on
    petitions under § 2254. See Stow, 
    389 F.3d at 888
    .
    Second, § 2254 applies to prisoners challenging “custody
    pursuant to the judgment of a State court,” and Dominguez is
    no longer challenging such a judgment; he is now a pretrial
    detainee.
    Section 2254(a) “deploys the term ‘in custody’ twice.”
    Bailey v. Hill, 
    599 F.3d 976
    , 978 (9th Cir. 2010). It states
    that “a district court shall entertain an application for a writ
    of habeas corpus in behalf of a person [1] in custody pursuant
    to the judgment of a State court only on the ground that he is
    [2] in custody in violation of the Constitution or laws or
    treaties of the United States.” 
    28 U.S.C. § 2254
    (a) (emphasis
    added).
    As to the first use of the word custody, we have held that
    a person is “in custody pursuant to the judgment of a State
    court” when “the source of the petitioner’s custody” is a state
    court judgment – i.e., when “‘the prisoner’s custody is
    attributable, at least in part,’” to such a judgment. White,
    
    370 F.3d at
    1007–08 (quoting Johnson, supra, at 162).
    With respect to the second use of the word custody, we
    have not yet addressed whether it too must be “pursuant to
    the judgment of a State court” – i.e., whether there must be a
    nexus between “the judgment of a State court” and the
    “custody” the petitioner contends is “in violation of the
    DOMINGUEZ V. KERNAN                      21
    Constitution or laws or treaties of the United States.”
    Rulemakers, courts and commentators, however, have all
    assumed that this nexus is required.
    The Rules Governing 2254 Cases, for example, state:
    These rules govern a petition for a writ of
    habeas corpus filed in a United States district
    court under 
    28 U.S.C. § 2254
     by:
    (1) a person in custody under a state-court
    judgment who seeks a determination that the
    custody violates the Constitution, laws, or
    treaties of the United States; and
    (2) a person in custody under a state-court or
    federal-court judgment who seeks a
    determination that future custody under a
    state-court judgment would violate the
    Constitution, laws, or treaties of the United
    States.
    Rule 1, Rules Governing Section 2254 Cases in the United
    States District Courts, 28 U.S.C.A. foll. § 2254 (emphasis
    added). A leading habeas treatise likewise states:
    To invoke habeas corpus review by a federal
    court, the petitioner must satisfy two
    jurisdictional requirements – (1) the status
    requirement that the petition be “in behalf of
    a person in custody pursuant to the judgment
    of a State court”; and (2) the substance
    requirement that the petition challenge the
    legality of that custody on the ground that it is
    22                 DOMINGUEZ V. KERNAN
    “in violation of the Constitution or laws or
    treaties of the United States.”
    1 Hertz & Liebman, supra, § 8.1 (footnote omitted)
    (emphasis added). As the Seventh Circuit noted in Walker v.
    O’Brien, 
    216 F.3d 626
     (7th Cir. 2000), Ҥ 2254 [is] the
    exclusive vehicle for prisoners in custody pursuant to a state
    court judgment who wish to challenge anything affecting that
    custody.” Id. at 633 (emphasis added).
    In light of the language, history and purpose of § 2254,
    we conclude § 2254 requires a nexus between “the judgment
    of a State court” and the “custody” the petitioner contends is
    “in violation of the Constitution or laws or treaties of the
    United States.” The custody the petitioner challenges must be
    “attributable, at least in part, to a judgment of a State court.”
    White, 370 F.3d at 1007–08 (quoting Johnson, supra, at 162).
    This does not mean that a § 2254 petition must present a
    challenge to the underlying state court judgment. “[T]he
    essence of habeas corpus is an attack by a person in custody
    upon the legality of that custody,” Preiser v. Rodriguez,
    
    411 U.S. 475
    , 484 (1973), not necessarily a challenge to a
    judgment. Section 2254, therefore, applies not only to
    challenges to a conviction or sentence but also to challenges
    to the “execution of a custodial sentence.” Bailey, 
    599 F.3d at 982
    ; see, e.g., Preiser, 
    411 U.S. at
    476–77 (§ 2254
    challenge to the loss of good-time credits); Spencer, 
    523 U.S. at
    7 (§ 2254 challenge to the revocation of parole); White,
    
    370 F.3d at
    1005 (§ 2254 challenge to an administrative
    decision transferring the petitioner from one prison to
    another). What matters is that the custody complained of is
    attributable in some way to the underlying state court
    judgment.
    DOMINGUEZ V. KERNAN                                23
    Here, there is no nexus between Dominguez’s now
    vacated judgment and the custody he contends violates the
    Double Jeopardy Clause. Because his pretrial detention is not
    attributable in any way to a state court judgment, his double
    jeopardy claim does not fall under § 2254.11
    In sum, we hold Dominguez is no longer required to
    proceed under § 2254. He is no longer “in custody pursuant
    to the judgment of a State court,” and the custody he is
    challenging is not attributable in any way to a state court
    judgment. Dominguez, therefore, is free to proceed under
    § 2241(a) and (c)(3), without satisfying the additional
    requirements applicable to § 2254 petitions.
    11
    We recognize the Supreme Court has held that the “in custody”
    requirement of § 2254(a) must be satisfied only at the time the petition is
    filed. See Spencer, 
    523 U.S. at 7
     (“Spencer was incarcerated by reason of
    the parole revocation at the time the petition was filed, which is all the ‘in
    custody’ provision of 
    28 U.S.C. § 2254
     requires.”); Maleng v. Cook,
    
    490 U.S. 488
    , 490–91 (1989) (per curiam) (“We have interpreted the
    statutory language as requiring that the habeas petitioner be ‘in custody’
    under the conviction or sentence under attack at the time his petition is
    filed.”); Carafas, 
    391 U.S. at 238
     (“[W]e conclude that under the statutory
    scheme, once the federal jurisdiction has attached in the District Court, it
    is not defeated by the release of the petitioner prior to completion of
    proceedings on such application.”). These cases, however, stand for the
    limited proposition that, when a petitioner is in custody at the time the
    petition is filed, “the federal court may pass on the merits of the petition
    even though the prisoner is unconditionally released before the petition is
    acted upon, provided that the petitioner still suffers collateral
    consequences from the conviction.” 17B Charles Alan Wright & Arthur
    R. Miller, Federal Practice and Procedure § 4262 (3d ed. 2018). We are
    not aware of any authority suggesting that a petitioner must continue to
    proceed under § 2254, rather than § 2241, when the custody he currently
    is challenging is not attributable in any way to a judgment, and hence
    bears no presumption of legitimacy.
    24                 DOMINGUEZ V. KERNAN
    C. Dominguez’s Petition May Be Converted to § 2241
    Dominguez, moreover, is not required to dismiss his
    § 2254 petition and file a new petition under § 2241.
    Courts and commentators have recognized that, “[i]f the
    petition is filed by a pre-trial detainee under § 2241 who is
    subsequently convicted, the federal court may convert the
    § 2241 petition to a § 2254 petition.” Means, Postconviction
    Remedies, supra, § 5:2 (citing Yellowbear v. Wyoming Att’y
    Gen., 
    525 F.3d 921
    , 924 (10th Cir. 2008); Jackson v. Coalter,
    
    337 F.3d 74
    , 79 (1st Cir. 2003)). We now hold that the same
    rationale applies where, as here, the opposite situation arises.
    Where a petition is filed by a post-conviction detainee under
    § 2254 and the conviction subsequently is vacated, the federal
    court has the authority – at the petitioner’s request or with the
    petitioner’s consent – to convert the § 2254 petition to a
    § 2241 petition. Cf. Stow, 
    389 F.3d at 885
     (holding the
    petitioner’s pretrial double jeopardy challenge, filed under
    § 2254, should be treated as a petition under § 2241).
    D. Remaining Issues
    The district court cited two additional potential obstacles
    to Dominguez’s double jeopardy claim: (1) whether
    Dominguez has adequately exhausted the claim; and
    (2) whether the Double Jeopardy Clause bars his prosecution
    on a charge of conspiracy to commit murder when his
    previous acquittal applied, if at all, solely to the charge of
    murder. As the district court noted, these additional issues
    were not adequately developed, and the district court did not
    reach them. We leave them for the district court to address in
    the first instance.
    DOMINGUEZ V. KERNAN                       25
    CONCLUSION
    We hold Dominguez’s federal habeas petition continues
    to present a live controversy challenging his ongoing second
    prosecution as a violation of the Double Jeopardy Clause.
    We further hold Dominguez is no longer required to proceed
    under § 2254. Finally, we hold a district court has the
    authority to convert a § 2254 petition into a § 2241 petition
    where the petitioner’s circumstances change during the
    pendency of the proceedings. We vacate the judgment of the
    district court and remand for proceedings consistent with this
    opinion.
    Because Dominguez’s detention is no longer attributable
    to a state court judgment, proceeding under § 2254 is no
    longer appropriate. On remand, the district court shall, either
    upon Dominguez’s request or at the court’s initiation but with
    Dominguez’s consent, convert the petition to one arising
    under § 2241. If Dominguez elects not to convert the
    petition, the district court shall dismiss the petition without
    prejudice.
    Costs of appeal are awarded to Dominguez.
    VACATED AND REMANDED.