Judge:1
The petitioner, Omarri Hill, seeks a writ of habeas corpus to release him from custody, arguing he completed his term of incarceration on 28 January 1995 and is now being illegally detained.
Hill was arrested and charged with first-degree murder on 28 August 1991, less than two months after his fifteenth birthday. On that August day, Hill was on the second floor balcony of an apartment building with two other young men. The victim, twenty-year-old David Johnson, had just exited his ear and was walking across a nearby parking lot when he was shot and killed. Hill later turned himself in and confessed to killing Johnson with a shot from a .22 rifle. Hill did not know Johnson and admittedly had no reason for shooting him.
Hill was initially detained at the Kanawha Home for Children, but on 7 April 1992, the Circuit Court of Kanawha County transferred him to adult status. On 1 September 1992, because of prosecutorial delay and his own good conduct, Hill was released on home confinement pending further proceedings in his case.
On 15 December 1992, Hill entered into a plea agreement under which he plead guilty to second-degree murder. Pursuant to W.Va.Code § 61-2-3, Hill was sentenced to an indeterminate term of not less than five nor more than eighteen years in the penitentiary2 and, in conformance with W.Va.Code § 49-5-16(b),3 he was immediately commit*690ted to the Industrial Home for Youths until he reached his eighteenth birthday. After serving approximately two and one-half years in juvenile custody and upon reaching eighteen years of age, Hill was returned to the circuit court, where a dispositional hearing was held pursuant to W.Va.Code § 49-5-16(b) to permit reconsideration and modification of his sentence. In a letter to the circuit court dated 24 May 1994, the Commissioner of the Department of Corrections recommended the following:
Due to the severity of the crime, it is understood that further incarceration is necessary. It is recommended that Omar-ri serve the remainder of his sentence at a minimum security adult facility, such as the Anthony Center in Neola, West Virginia.
Also, it is suggested that at least the remainder of the minimum sentence be served before release is considered.
At this point, there seems to have been a breakdown in communications between the State, the court,4 and the Department of Corrections. At a hearing on 15 June 1994, the State recommended, in accordance with the Commissioner of Corrections’ letter, that Hill be sentenced to the Anthony Center as a youthful offender. However, the State’s recommendation did not encompass the Commissioner’s admonition that Hill serve a minimum of two years at the Anthony Center. Rather, the State recommended that he be therein confined “... until he completes [the] program.” The petitioner, of course, requested direct probation. The circuit court took the matter under advisement.
In an order entered on 6 July 1994, the circuit court suspended imposition of the original indeterminate sentence of five to eighteen years and ordered that Hill be committed to the custody of the Commissioner of Corrections for assignment to a youthful offender center. The court also ordered “That the period of confinement in the center shall be for six (6) months, or longer, if it is deemed advisable by the center superintendent, but in any event such period of confinement shall not exceed two (2) years.” The State entered no objection to the sentence.
Hill successfully completed the Anthony Center sentence on 28 January 1995. He claims that in accordance with W.Va.Code § 25-4-6, upon completion of the Anthony Center program, he was entitled to be returned to the sentencing court,5 and to be immediately placed on probation. However, when he returned to court for disposition on 6 February 1995, the State unexpectedly, and for the first time, challenged the legality of the youthful offender sentence and the constitutionality of W.Va.Code §§ 25-4-6 and 49-5-16(b). In an order entered 1 May 1995, the respondent judge found the completed sentence was erroneously imposed by the successor judge and reinstated the longer sentence initially imposed by the original judge. The respondent judge said the sentence to the Anthony Center was illegal because the statute requires that in order to get youthful offender treatment, the defendant must be at least sixteen years of age at the time the crime was committed, and Om-arri Hill was only fifteen. The judge also agreed with the State’s position and held W.Va.Code §§ 25-4-6 and 49-5-16(b) unconstitutional.
Counsel for the petitioner now argues his continued incarceration is illegal because the imposition of an additional term of confinement after his completion of the judicially-imposed sentence to the Anthony Center is a violation of the double jeopardy clause, as set forth in Article III, Section 5 of the West *691Virginia Constitution and the Fifth Amendment to the United States Constitution.6
The State replies that double jeopardy considerations are irrelevant because the petitioner’s sentence to the Anthony Center was illegal and/or void, due to his age at the time of the commission of the offense and the unconstitutionality of the sentencing statutes.
Thus, the primary issue before us is as follows: was the petitioner’s sentence of six months to two years at the Anthony Center for Youthful Offenders illegal because (1) the petitioner was technically ineligible for youthful offender treatment because he was less than sixteen years of age at the time of the commission of the offense, and (2) W.Va. Code §§ 25-4-6 and 49-5-16(b) are unconstitutional as an intrusion upon the sentencing powers of the court? We answer in the negative.
As we noted above, the record indicates the State failed to object when the circuit court ordered Hill to serve six months to two years at the Anthony Center. The statute which gave the circuit court judge the authority to impose this sentence — W.Va.Code § 25-4-6 — expressly provides that a juvenile male offender who successfully completes a center training program “shall be returned to the jurisdiction of the court which originally committed him. He shall be eligible for probation for the offense with which he is charged, and the judge of the court shall immediately place him on probation.” If the State wanted Omarri Hill to serve a full two years at the Anthony Center, it should have requested this at the time of sentencing, and, if not successful, objected to the imposition of the indeterminate six-month-to-two-year sentence that quite clearly placed him in the position of being eligible for probation in a mere six months. To assume that Hill would serve the full two years at the Anthony Center under a six-month-to-two-year sentence was to expect him to fail, when, in fact, Hill had thus far given all indications of responding favorably to the State’s rehabilitative efforts.
Without question, sentencing the petitioner under the youthful offender statute was technically improper in light of his age at the time he committed the crime, i.e., he was too young. However, in our opinion, this particular infirmity does not render the sentence illegal or void ab initio. To penalize the petitioner because he was actually not old enough to receive youthful offender treatment is contrary to the very purposes and objectives of youthful offender status, i.e., “to give better opportunity to youthful offenders for reformation and encouragement of self-discipline.” 7 A sentence which is technically infirm, but generally and substantially complies with the spirit and purpose of the law, as does the sentence in the instant case, is not void, but merely voidable. The State or the complaining party may challenge the sentence by timely objection. However, failure to object constitutes a waiver of the right to challenge the legality of the sentence.
It is clear in this case that the State, through its prosecuting attorney, (1) failed to object to the treatment of the petitioner as a youthful offender at the time of sentencing;8 (2) failed to timely object to the sentence after it was imposed; and (3) failed to move for a correction of the sentence under Rule 35(a) of the West Virginia Rules of Criminal Procedure subsequent to its imposition.9 Therefore, we find that the sentence, which was voidable when imposed, became legal when it was not properly challenged by the State in a timely manner.10
*692In syllabus point 1 of Sellers v. Broadwater, 176 W.Va. 232, 342 S.E.2d 198 (1986), this Court recognized that any attempt to increase a sentence after a valid sentence has been served is a violation of the double jeopardy clause.
A criminal court may, for certain purposes, set aside a judgment by an order entered during the same term at which the order set aside was spread upon the records of the court; however, in criminal cases where the judgment has been satisfied in whole or in part this power is limited to those cases in which the trial court reduces the penalty imposed, and cases in which the penalty is increased are treated as cases subjecting the accused to double jeopardy.
Accordingly, the reimposition of the original sentence of five to eighteen years would now be unconstitutional because the petitioner has served what we have determined was a valid sentence as a youthful offender.
Next, the State challenges the constitutionality of the sentencing statutes by arguing (1) W.Va.Code § 25-4-6 improperly mandates probation upon successful completion of a youthful offender sentence, and (2) W.Va. Code § 49 — 5—16(b) prohibits the transfer to the penitentiary of a defendant upon reaching majority, absent the acquiescence of the Department of Corrections.11 In its 1 May
1995 order, the lower court held W.Va.Code §§ 25-4-6 and 49-5-16(b) unconstitutional. The position now advanced by the State in support of this ruling is that these provisions “require that the sentencing judge implement the recommendations of the Commissioner of Corrections under certain circumstances, regardless of the discretion regarding sentencing given to the circuit courts under the statutes governing the crime committed.” The State argues this “constitutes an impermissible intrusion by the executive branch into the power of the courts,” and any sentences imposed pursuant to these statutes are illegal. We disagree with this assertion.
Counsel for the petitioner correctly points out that “similar sentencing provisions have been reviewed numerous times in other states and in the federal courts and have been uniformly upheld.” For example, in Mistretta v. United States, 488 U.S. 361, 364, 109 S.Ct. 647, 650-51, 102 L.Ed.2d 714, 725 (1989), the United States Supreme Court recognized that “[hjistorically, federal sentencing — the function of determining the scope and extent of punishment — never has been thought to be assigned by the Constitution to the exclusive jurisdiction of any one of the three Branches of Government.” The court explained: “... with the advent of parole, Congress moved toward a ‘three-way sharing’ of sentencing responsibility by granting corrections personnel in the Executive *693Branch the discretion to release a prisoner before the expiration of the sentence imposed by the judge.” 488 U.S. at 364-65, 109 S.Ct. at 651, 102 L.Ed.2d at 726. The Court rejected the argument that sentencing mandates violate the separation of powers, and concluded that “the scope of judicial discretion with respect to a sentence is subject to congressional control.” 488 U.S. at 364, 109 S.Ct. at 651, 102 L.Ed.2d at 726.
In State v. Reed, 248 Kan. 792, 811 P.2d 1163,1165 (1991), the Kansas Supreme Court rejected a constitutional challenge to a statute which provides “a district court shall modify a defendant’s sentence when recommended by the [Kansas Department of Corrections].” The Kansas Supreme Court explained:
The basic meaning of the separation of powers doctrine is that the whole power of one department should not be exercised by the same hands which possess the whole power of either of the other departments .... It does not necessarily follow, however, that an entire and complete separation is either desirable or was ever intended by the framers of the Constitution. The fact that the powers of one department may overlap with another department’s powers has long been a recognized fact.
Id. 811 P.2d at 1167, citing State v. Greenlee, 228 Kan. 712, 620 P.2d 1132 (1980) (citations omitted).
Similarly, this Court “has long recognized that it is not possible that division of power among the three branches of government be so precise and exact that there is no overlapping whatsoever.” State ex rel. Sahley v. Thompson, 151 W.Va. 336, 341, 151 S.E.2d 870, 873 (1966). “While the Constitution contemplates the independent operation of the three fields of government as to all matters within their respective fields, there can be no doubt that the people, through their Constitution, may authorize one of the departments to exercise powers otherwise rightfully belonging to another department.” State ex rel. Thompson v. Morton, 140 W.Va. 207, 223, 84 S.E.2d 791, 800-01 (1954).
Counsel for the petitioner points to instances in which the State legislature has either mandated the length of sentences or placed the length of sentences in the executive branch. For example, the delegation of authority to the Board of Probation and Parole, which can parole a person despite opposition of a judge and prosecuting attorney, has never been successfully challenged.12
The legislature has also imposed mandatory sentencing requirements upon judges in certain areas of the law. West Virginia Code § 60A-4-401(c) and 402(c) requires probation for first offense distribution of less than fifteen grams of marijuana. This statutory provision was upheld by this Court in State v. Carper, 176 W.Va. 309, 312, 342 S.E.2d 277, 281 (1986), in which we stated:
The implicit point made in [State v.] Du-dick [158 W.Va. 629, 213 S.E.2d 458 (1975) ] is that where the legislature has mandated probation treatment in one section of the Uniform Controlled Substances Act, the section dealing with probation, W.Va.Code, 60A-4-407, must be treated as mandatory. This is precisely the point in this case, with W.Va.Code, 60A-4-402(c), mandating treatment under the probation section, W.Va.Code, 60A-4-407.
Likewise, W.Va.Code § 17C-5-2 makes a sentence mandatory in DUI cases by removing judicial discretion to grant probation.
It is the conclusion of this Court that the discretionary authority vested in the Commissioner of Corrections by W.Va.Code §§ 25-4-6 and 49-5-16(b) does not intrude upon the sentencing powers of the courts in an unconstitutional manner. The sentences imposed pursuant to these statutes are neither illegal nor void. Therefore, we must follow the plain language of the statute under which the petitioner, Omarri Hill, was sentenced, W.Va.Code § 25-4-6, which provides that, upon satisfactory completion of the center training program, “the judge shall immediately place him on probation.”
For the foregoing reasons, we hereby issue a writ of habeas corpus to the respondent, Larry F. Parsons, Administrator of the South Central Regional Jail, directing that *694the petitioner be immediately released from custody.
Writ granted.
BROTHERTON, J., did not participate. FOX, Judge, sitting by temporary assignment. WORKMAN, J., concurs and reserves the right to file a concurring opinion..Pursuant to an administrative order entered by this Court on 18 November 1994, the Honorable Fred L. Fox, II, Judge of the Sixteenth Judicial Circuit, was assigned to sit as a member of the West Virginia Supreme Court of Appeals commencing 1 January 1995 and continuing through 31 March 1995, because of the physical incapacity of Justice W.T. Brotherton, Jr. On 14 February 1995 a subsequent administrative order extended this assignment until further order of said Court.
. West Virginia Code § 61-2-3 (1992) states that "[m]urder of the second degree shall be punished by confinement in the penitentiary not less than five nor more than eighteen years.”
. West Virginia Code § 49-5-16(b) (1992) provides:
No child who has been convicted of an offense under the adult jurisdiction of the circuit court shall be held in custody in a penitentiary of this State: Provided, That such child may be *690transferred from a secure juvenile facility to a penitentiary after he shall attain the age of eighteen years if, in the judgment of the commissioner of the department of corrections and the court which committed such child, such transfer is appropriate: Provided, however, That any other provision of this Code to the contrary notwithstanding, prior to such transfer the child shall be returned to the sentencing court for the purpose of reconsideration and modification of the imposed sentence, which shall be based upon a review of all records and relevant information relating to the child’s rehabilitation since his conviction under the adult jurisdiction of the court.
. For reasons not apparent from the record, the judge at this dispositional hearing was not the judge who originally sentenced the petitioner.
. By this time, a third judge, the respondent Paul Zakaib, Jr., had assumed jurisdiction of this case.
. Article III, Section 5 of the West Virginia Constitution states, in pertinent part, that no person shall "be compelled to be a witness against himself, or be twice put in jeopardy of life or liberty for the same offence.”
. West Virginia Code § 25-4-1 (1992).
. Not only did the State fail to object to youthful offender treatment for the petitioner, it recommended it, as previously indicated.
. Rule 35(a) states that "[t]he court may correct an illegal sentence at any time and may correct a sentence imposed in an illegal manner within the time provided herein for the reduction of sentence."
. Even if we were to determine that the sentence was illegal, there is at least an argument that due process considerations weigh against correcting the sentence after it is served. In United States v. Lundien, 769 F.2d 981, 987 (1985), the Fourth Circuit Court of Appeals ex*692plained that "... due process may also be denied when a sentence is enhanced after the defendant has served so much of his sentence that his expectations as to its finality have crystallized and it would be fundamentally unfair to defeat them." The Fourth Circuit then cited the principle as it was stated by the First Circuit:
|T]he power of a sentencing court to correct even a statutorily invalid sentence must be subject to some temporal limit. When a prisoner first commences to serve his sentence, especially if it involves a long prison term as here, the prospect of release on parole or otherwise may seem but a dimly perceived, largely unreal hope. As the months and years pass, however, the date of that prospect must assume a real and psychologically critical importance. The prisoner may be aided in enduring his confinement and coping with the prison regime by the knowledge that with good behavior release on parole or release outright will be achieved on a date certain. After a substantial period of time, therefore, it might be fundamentally unfair, and thus violative of due process for a court to alter even an illegal sentence in a way which frustrates a prisoner's expectations by postponing his parole eligibility or release date far beyond that originally set.
Breest v. Helgemoe, 579 F.2d 95, 101 (1st Cir.) (affirming trial court’s increase of minimum sentence from eighteen to forty years after defendant served fourteen days), cert, denied, 439 U.S. 933, 99 S.Ct. 327, 58 L.Ed.2d 329 (1978).
. The State is objecting to the language in W.Va.Code § 49-5-16(b), which provides: "... [tjhat such child may be transferred from a secure juvenile facility to a penitentiary after he shall attain the age of eighteen years if, in the judgment of the commissioner of the department of corrections and the court which committed such child, such transfer is appropriate^]" This statute was amended by the legislature in 1995, and the language referring to the judgment of the Commissioner of the Department of Corrections was deleted. However, in order to resolve the case' now before us, we will address the issue of the constitutionality of the prior statute.
. See 49 Op.Att'y Gen. 429 (1962).