
989 S.W.2d 515 (1999)
337 Ark. 494
Sherman Dale RENSHAW, Appellant,
v.
Larry NORRIS, Director, Arkansas Department of Correction, Appellee.
No. CR 97-1074.
Supreme Court of Arkansas.
May 13, 1999.
*516 Sherman Dale Renshaw, Grady, pro se.
J. Winston Bryant, Atty. Gen., Kelly K. Hill, Deputy Atty. Gen., for Appellee.
RAY THORNTON, Justice.
Appellant, Sherman Dale Renshaw, brings this writ of habeas corpus, alleging that he is being illegally detained pursuant to a sentence longer than that authorized by statute. Upon conviction of three felonies, appellant was sentenced on July 26, 1989, to a total of fifty years' imprisonment. A judgment and commitment order was filed sentencing appellant to fifty years for possession of a schedule II narcotic, a class Y felony; to thirty years for possession of a schedule II stimulant, a class B felony; and to ten years for possession of drug paraphernalia, a class C felony. The judgment and commitment order provided that these sentences would run concurrently for a total of fifty years.
Upon a motion for postconviction relief to the trial court, the sentences of fifty years for the class Y felony and thirty years for the class B felony were challenged as exceeding the statutory maximums of forty and twenty years respectively. See Ark.Code Ann. § 5-64-401(a)(1)(i) and (ii) (1987). Under the authority of the postconviction relief provided by Ark.Code Ann. § 16-90-111(a)[1], the *517 court entered an amended order on November 21, 1989, which: 1) did not alter the excessive thirty-year sentence for the class B felony; 2) corrected the sentence for the class Y felony by reducing it to the statutory maximum of forty years; and 3) reimposed the valid ten-year sentence for the possession of drug paraphernalia, but modified that sentence to run consecutively to the forty-year corrected sentence for the class Y felony, thereby imposing a cumulative sentence of fifty years. We conclude that the trial court failed to correct the illegal thirty-year sentence, and lacked jurisdiction to modify the valid ten-year sentence by expanding it to run consecutively to the forty-year sentence. Therefore, we reverse and remand to the trial court for appropriate relief.
The Arkansas Constitution provides: "The privilege of the writ of habeas corpus shall not be suspended, except by the General Assembly, in case of rebellion, insurrection or invasion, when the public safety may require it." Ark. Const. art. 2 § 11. The General Assembly has enacted statutory procedures to be followed in obtaining habeas corpus relief. See Ark.Code Ann. §§ 16-112-101 through XX-XX-XXX (1987). And this court has made it clear that the writ is appropriate when a person is detained without lawful authority. See Kozal v. Board of Correction, 310 Ark. 648, 840 S.W.2d 164 (1992).
Detention for an illegal period of time is precisely what a writ of habeas corpus is designed to correct. American Jurisprudence 2d states the fundamental principle of law:
Challenges to the length of confinement are properly considered in the context of habeas corpus proceedings. Thus, the unlawful confinement of an individual under a sentence longer than that permitted by statute constitutes a denial of liberty without due process of law, and a petitioner alleging such confinement is entitled to seek habeas corpus relief under the Great Writ.
39 AM. JUR.2d § 66 (1999). The Great Writ provides protection for petitioners who are confined under sentences longer than that permitted by statute. See, e.g., Manville v. Hampton, 266 Ga. 857, 471 S.E.2d 872 (1996); State v. Purkett, 908 S.W.2d 690 (Mo. 1995). In Manville, the Georgia Supreme Court noted that if the petitioner was confined for a sentence longer than that permitted by statute, this would be a denial of liberty without due process of law and a writ of habeas corpus would issue. In Purkett, the petitioner was sentenced to fifteen years for attempted sodomy when the maximum sentence was seven years. The Missouri Supreme Court wrote that habeas corpus was the proper remedy for one sentenced in excess of what was authorized by law. Because the petitioner had served the authorized sentence, he was ordered discharged from detention.
Many jurisdictions employ the writ of habeas corpus to reduce the term of an excessive sentence to that authorized by statute although the petitioner has not yet completed the valid portion of his sentences. See, e.g., In re Tartar, 52 Cal.2d 250, 339 P.2d 553 (1959); Landreth v. Gladden, 213 Or. 205, 324 P.2d 475 (1958); Ex parte Hill, 528 S.W.2d 125 (Tex.Crim.App.1975). See also, United States v. Wilson, 997 F.2d 429 (8th Cir.1993).
A writ of habeas corpus will issue where a commitment is invalid on its face or where the sentencing court lacked subject-matter jurisdiction to enter or modify the sentence. See, e.g., Sawyer v. State, 327 Ark. 421, 938 S.W.2d 843 (1997), Mackey v. Lockhart, 307 Ark. 321, 819 S.W.2d 702 (1991). When a habeas corpus petition alleges that a sentence is void or illegal, we review the matter of the trial court's subject-matter jurisdiction to enter such sentences regardless of whether an objection was made to the trial court. Howard v. State, 289 Ark. 587, 715 *518 S.W.2d 440 (1986). See also Lambert v. State, 286 Ark. 408, 692 S.W.2d 238 (1985). The Arkansas Court of Appeals in Ashe v. State, 57 Ark.App. 99, 942 S.W.2d 267 (1997), reiterated our treatment of allegations of illegal sentences:
The State may raise at any time the illegality of reducing a sentence, and the issue of an illegal sentence may be raised for the first time on appeal. In Bangs v. State, 310 Ark. 235, 239, 835 S.W.2d 294 (1992), the Arkansas Supreme Court said, "[W]e treat allegations of void or illegal sentences similar to problems of subject matter jurisdiction in that we review such allegations whether or not an objection was made in the trial court. Howard v. State, 289 Ark. 587, 715 S.W.2d 440 (1986). A sentence is void when the trial court lacks authority to impose it. Id."
The question then becomes whether there are time limits on when a petitioner must file a writ of habeas corpus based on an illegal sentence. Certainly, a petitioner cannot waive a court's lack of subject-matter jurisdiction. And neither the Arkansas Constitution nor the state statutes place a time limit on pursuing a writ of habeas corpus. Indeed, to do so would contravene the proscription against suspending the right to habeas corpus.
There is the pronouncement in Bilderback v. State, 319 Ark. 643, 893 S.W.2d 780 (1995), that we do not consider the question of an illegal sentence, except in life imprisonment or death-sentence cases, unless raised on appeal. Bilderback was not a habeas corpus case. In fact, it was the State that pointed out in Bilderback that the six-year sentence imposed might have exceeded what was allowable by statute. It is clear that Bilderback cannot be read as placing a time limit on when a writ of habeas corpus must be filed. Such an interpretation to limit the remedy of habeas corpus would be a "suspension" and would violate the Arkansas Constitution. See Ark. Const. art. 2 § 11.
The trial court did have jurisdiction to correct the illegal fifty-year sentence for a class Y felony by reducing it to the statutory maximum of forty years. Bangs v. State, 310 Ark. 235, 835 S.W.2d 294 (1992); In re Bonner, 151 U.S. 242, 14 S.Ct. 323, 38 L.Ed. 149 (1893). However, once the trial court corrected the illegal term of fifty years by reducing it to the statutory maximum of forty years as prescribed by Ark.Code Ann. § 5-64-401(a)(1)(i) (1987), it lacked jurisdiction to further modify or increase that sentence. Nelson v. State, 284 Ark. 156, 680 S.W.2d 91 (1984); Massey v. State, 278 Ark. 625, 648 S.W.2d 52 (1983).
Appellant's original thirty-year sentence for a class B felony remains invalid on its face because it does not conform to the statutory maximum of twenty years. Ark. Code Ann. § 5-64-401(a)(1)(ii) (1987). Where a trial court exceeded its authority in imposing an illegal sentence, we have said that this court could consider such a matter, even though not raised at trial, because subject-matter jurisdiction cannot be waived by the parties. Lambert v. State, 286 Ark. 408, 692 S.W.2d 238 (1985). Where a trial court's error has nothing to do with guilt or innocence and relates only to punishment, it may be corrected in lieu of reversing and remanding. Bangs v. State, 310 Ark. 235, 835 S.W.2d 294 (1992).
Accordingly, we hold that the petition for a writ of habeas corpus should be granted because the original trial judge sentenced Renshaw to thirty years for a class B felony when the statutory maximum is twenty years. We need not decide in this case whether the trial court's action in proceeding without subject-matter jurisdiction to modify the valid ten-year sentence for a class C felony by making it run consecutively rather than concurrently is subject to the writ of habeas corpus because of the availability of another remedy. Arkansas Code Ann. § 16-90-111, the provision for postconviction relief in effect from May 30, 1989 until January 1, 1991, provides authority to correct an illegal sentence at any time. Appellant raises the applicability of this postconviction relief in his pleading, and as we have previously noted, we have authority to address the issue of subject-matter jurisdiction regardless of whether an objection was made to the trial court. Howard v. State, supra.
*519 As we stated in Redding v. State, 293 Ark. 411, 738 S.W.2d 410 (1987), once a valid sentence has been put into execution, the trial court is without jurisdiction to modify, amend, or revise it. With regard to the valid ten-year sentence, we have stated that the trial court is without jurisdiction to change a judgment from concurrent to consecutive after the first part of the sentence has been put into execution. Nelson v. State, 284 Ark. 156, 680 S.W.2d 91 (1984). Because the trial court lacked jurisdiction to convert or modify appellant's valid ten-year sentence for the Class C felony to run consecutively rather than concurrently with the corrected forty-year sentence, the resulting cumulative fifty-year sentence was illegal. The ten-year sentence, as originally imposed, could not be modified and must continue to run concurrently with the other sentences.
We wrote in Bangs v. State, 310 Ark. 235, 241, 835 S.W.2d 294, 297 (1992):
[T]he remedy for an illegal sentence is not dismissal of all related proceedings in the trial court and release from imprisonment.... The general rule is that if the original sentence is illegal, even though partially executed, the sentencing court may correct it. Lambert v. State, 286 Ark. 408, 692 S.W.2d 238 (1985) (citing In re Bonner, 151 U.S. 242, 14 S.Ct. 323, 38 L.Ed. 149 (1893)); see Gage v. State, 307 Ark. 285, 819 S.W.2d 279 (1991).
Accordingly, we hold that the trial court lacked subject-matter jurisdiction to change the valid ten-year sentence from running concurrently to running consecutively. The result was an illegal sentence that may be corrected under Ark.Code Ann. § 16-90-111(a) (1987), which was the postconviction relief available while Rule 37 was on hiatus.
Based upon the writ of habeas corpus and the statutory provision for postconviction relief, we conclude that Renshaw is illegally detained to the extent that the sentences are excessive. We hold that the sentence for the conviction of the class B felony should be corrected to the twenty-year maximum sentence provided by statute, with that sentence to run concurrently with the sentences of forty years for the class Y felony and ten years for the class C felony, with the aggregate sentence for a term of forty years.
We reverse and remand to the trial court for the purpose of implementing the correction of the illegal sentences in accordance with this opinion.
Reversed and remanded.
GLAZE and CORBIN, JJ., concur in part and dissent in part.
TOM GLAZE, Justice, concurring in part; dissenting in part.
Sherman Renshaw's remedy in this case is Ark.Code Ann. § 16-90-111(a) (1987), which was in effect at the time of his sentencing. That provision provides that a circuit court may correct an illegal sentence at any time. See also Bangs v. State, 310 Ark. 235, 835 S.W.2d 294 (1992). Because Renshaw's original thirty-year sentence exceeds the statutory maximum of twenty years, see Ark.Code Ann. § 16-90-111(a), that sentence should have been reduced as provided under § 16-90-111(a). The trial court erred in refusing to do so. In this appeal, the majority court is correct in holding the trial court erred in failing to award Renshaw relief, but the majority is wrong in correcting Renshaw's sentence by granting a writ of habeas corpus.
In authorizing the remedy of habeas corpus to correct Renshaw's thirty-year illegal sentence, the majority has added a means by which a prisoner can now circumvent Rule 37 and its time limitations that control illegal-sentencing matters. Rule 37.1 in pertinent part provides that a prisoner may have his or her original sentence modified on the ground that (a) the sentence was imposed in violation of the Constitution and laws of the United States or this state, or (b) the court imposing the sentence was without jurisdiction to do so, or (c) the sentence was in excess of the maximum sentence authorized by law, or (d) the sentence is otherwise subject to collateral attack. However, to obtain such relief, the prisoner is required to file a petition to correct an illegal sentence within ninety days from the conviction judgment and pronouncement of sentence. Rule 37.2.
Here, the appellant failed to file a direct appeal, nor did he file a timely postconviction *520 petition. Arkansas law is well settled that a habeas corpus proceeding will not be issued as a substitute for postconviction relief. Mackey v. Lockhart. 307 Ark. 321, 819 S.W.2d 702 (1991). In my opinion, RenShaw's illegal thirty-year sentence can be corrected only under § 16-90-111(a), not by a writ of habeas corpus.
In conclusion, I also agree with the majority in holding the trial court erred when it modified Renshaw's ten-year sentence to run consecutively rather than concurrently as provided in Renshaw's original order. The rule is well settled that once a valid sentence has been put into execution, the trial court is without jurisdiction to modify, amend, or revise it. Redding v. State, 293 Ark. 411, 738 S.W.2d 410 (1987). Because the trial court entered an illegal ten-year consecutive sentence, the trial court's order should be corrected, as is permitted under § 16-90-111(a).
CORBIN, J., joins this opinion.
NOTES
[1]  Ark. R.Crim. P. 37 was abolished on May 30, 1989, and was not reinstated until January 1, 1991; thus Ark.Code Ann. § 16-90-111 was available for appellant's postconviction relief. The pertinent portion of that section reads;

(a) A circuit court, upon receipt of petition by the aggrieved party for relief and after the notice of relief has been served on the prosecuting attorney, may correct an illegal sentence at any time and may correct a sentence imposed in an illegal manner within the time provided in this sentence for the reduction of sentence.
Ark Code Ann. § 16-90-111(a) (1987) (emphasis added).
