[Until this opinion appears in the Ohio Official Reports advanc e sheets, it may be cited as State ex rel. Slaughter v. Foley , Slip Opinion No. 2021-Ohio-4049.]

NOTICE This slip opinion is subject to f ormal revision before it is pu blished in an advance sheet of the Ohio Official Reports. Readers are reques ted to promptly notify the Reporter of Decisions, Supreme Court of Ohi o, 65 South Front Street, Columbus, Ohio 43215, of any typographical or other formal errors in the opinion, in order that corrections may be made before the opinion is published.

S LIP O PINION N O
. 2021-O HIO -4049
T HE S TATE EX REL
. S LAUGHTER , A PPELLANT , v . F OLEY , W ARDEN , A PPELLEE .

[Until this opinion appears in t he Ohio Official Reports advanc e sheets, it may be cited as State ex rel. Slaughter v. Foley , Slip Opinion No. 2021-Ohio-4049.] Habeas corpus—If a court has jurisdicti on over the case and the person, any error in the court’s exercise of that juri sdiction, including sentences in which a trial court fails to impose a stat utorily mandated term, is voidable—A
sentence that is voidable cannot be challenged in habeas corpus, because the inmate has an adequate remedy through direct appeal—Court of appeals’ judgment dismissing complaint affirmed. (No. 2021-0416—Submitted September 7, 2021—Decided November 17, 2021.)
A PPEAL from the Court of Appeal s for Lorain County No. 20CA11659, 2021-Ohio-545.

________________S UPREME C OURT OF O HIO

2 Per Curiam. {¶ 1} Appellant, Kevin Slaugh ter, an inmate at the Grafton Correction al Institution, appeals the judgment of the Ninth District Court o f Appeals dismissing his complaint for a writ of habeas corpus against appellee, War den Keith Foley.
We affirm. Background {¶ 2} In January 1993, Slaughter pleaded guilty to aggravated robbery and was sentenced to a prison term of 10 to 25 years. See Lorain Cty. case No. 92CR04-
1574. He has served the full term. {¶ 3} Also in January 1993, Slaughter pl eaded guilty to aggravated mu rder with a capital specification. See Lorain Cty. case No. 92CR04-1558. The sentencing entry imposed a sentence of “[l]ife with parole elig ibility after 30 years.” {¶ 4} On July 30, 2020, Slaughter filed a petition for a writ of habe as corpus in the Ninth District Court of Appeals. He alleged that life i mprisonment with parole eligibility after 30 years was not a permissible sentence under Ohio law. Instead, he alleged, he should have been sentenced, under the l aw in effect at the time, to a term of 30 “full” years. Based on these allegations , Slaughter alleged that he was entitled to a writ of habeas corpus immediately releasin g him from
confinement. {¶ 5} The court of appeals granted Warden Foley’s motion to dismiss. 2021-Ohio-545, ¶ 1. The court held that Slaughter’s sentence w as voidable, not void, and therefore Slaughter di d not state a claim for relief in habeas corpus. Id

. at ¶ 10. {¶ 6} Slaughter appealed. Legal analysis {¶ 7} A writ of habeas corpus “is warranted in certain extraordinary circumstances ‘where there is an unlawful restraint of a person ’s liberty and there is no adequate remedy in the o rdinary course of law.’ ” Johnson v. Timmerman-January Term, 2021

3 Cooper , 93 Ohio St.3d 614, 616, 757 N.E.2d 1153 (2001), quoting Pegan v.
Crawmer , 76 Ohio St.3d 97, 99, 666 N.E.2d 1091 (1996). Habeas corpus will lie only if the petitioner is entitled to immediate release from co nfinement. State ex
rel. Jackson v. McFaul , 73 Ohio St.3d 185, 188, 652 N.E.2d 746 (1995). {¶ 8} We review de novo a decision granting a motion to dismiss under Civ.R. 12(B)(6). Alford v. Collins-McGregor Operating Co. , 152 Ohio St.3d 303, 2018-Ohio-8, 95 N.E.3d 382, ¶ 10. “A motion to dismiss for fai lure to state a claim upon which relief can be granted tests the sufficiency of the c omplaint.” VolbersKlarich v. Middletown Mgt., Inc. , 125 Ohio St.3d 494, 2010-Ohio-2057, 929 N.E.2d 434, ¶ 11. “Dismissal of a complaint for failure to state a cl aim upon which relief can be granted is appropriate if, after all factual allegations of the complaint are presumed true and all reasonable inferences are made in relator ’s favor, it appears beyond doubt that relator can prove no set of facts warranting relief.” Clark v.
Connor , 82 Ohio St.3d 309, 311, 695 N.E.2d 751 (1998). {¶ 9} Slaughter alleged that he could not be detained pursuant to a s entence that the trial court had no leg al authority to impose. But we rejected that argument
in State v. Henderson , 161 Ohio St.3d 285, 2020-Ohio-4784, 162 N.E.3d 776. In
Henderson , the trial court sentenced the inmate to a definite term of 15 years when it should have imposed an indefin ite sentence of 15 years to li fe. Id . at ¶ 1. We held that if a trial court has j urisdiction over the case and t he person, then any sentence or judgment based on an e rror in the court’s exercise of that jurisdiction is voidable, not void. Id . at ¶ 37. And a sentence that is voidable cannot be challenged in habeas corpus, because the inmate has an adequate remedy through direct appeal. Kelley v. Wilson , 103 Ohio St.3d 201, 2004-Ohio-4883, 814 N.E.2d 1222, ¶ 14. {¶ 10} In his merit brief, Slaughter c ontends that his habeas corpus p etition did not challenge his sentence as void. Rather, he claims that because the court had no statutory authority to impose the sentence it did, he was ra ising a challenge toS UPREME C OURT OF O HIO

4 the court’s subject-matter jurisdiction. We rejected this argu ment in Henderson when we held that the imposition of a statutorily unauthorized sentence by a court that otherwise has jurisdiction constitutes an error that is co rrectable on direct appeal, not a defect in that cour t’s subject-matter jurisdictio n. {¶ 11} The court of appeals correctly applied Henderson when it dismissed Slaughter’s petition. We affirm. Judgment affirmed.
O’C ONNOR , C.J., and K ENNEDY , F ISCHER , D E W INE , D ONNELLY , S TEWART , and B RUNNER , JJ., concur.

_________________ Kevin Slaughter, pro se. Dave Yost, Attorney General, and Jerri L. Fosnaught, Assistant Attorney General, for appellee.

_________________