UPON A REHEARING EN BANC
WILLIS, Judge.Convicted of possession of a weapon while an inmate in a correctional facility, in violation of Code § 53.1-203(4), Larry *497Joe Dargan, Jr., contends that the trial court erred (1) in modifying his sentence more than twenty-one days after its imposition and (2) in modifying his sentence without the intervention of a jury. A divided panel of this Court reversed the judgment of the trial court. See Dargan v. Commonwealth, Record No. 2239-96-3, 1997 WL 727733, November 25, 1997 (unpublished). We stayed the mandate of that decision and granted rehearing en banc. Upon rehearing en banc, we affirm the judgment of the trial court.
Dargan was convicted in a jury trial of possession of a weapon while an inmate in a correctional facility, in violation of Code § 53.1-203(4). That crime is a Class 6 felony, punishable by “a term of imprisonment of not less than one year nor more than five years, or in the discretion of the jury ... confinement in jail for not more than twelve months and a fine of not more than $2,500, either or both.” Code § 18.2-10(f).
The trial court erroneously instructed the jury that the punishment provided for Dargan’s crime was a term of imprisonment of not less than one year nor more than ten years, or, in the discretion of the jury, confinement in jail for not more than twelve months and a fine of not more than $2,500, either or both. The jury fixed Dargan’s punishment at imprisonment for ten years. By final order entered August 30, 1996, the trial court imposed that sentence.
By order entered October 28,1996, the trial court ruled that the jury had been instructed erroneously and that the sentence imposed August 30, 1996 exceeded the term authorized by law. Over Dargan’s objection, it set aside five years of that sentence and imposed a sentence of five years imprisonment.
“ ‘[T]he imposition of [a] void sentence does not terminate the jurisdiction of the [trial] court.’ ” Powell v. Commonwealth, 182 Va. 327, 340, 28 S.E.2d 687, 692 (1944) (citation omitted). A trial court may correct a void or unlawful sentence at any time. Id.
A court may impose a valid sentence in substitution for one that is void, even though service of the void sentence has been commenced. Where the sentence imposed is in *498excess of that prescribed by law, that part of the sentence which is excessive is invalid. A sentence in excess of one prescribed by law is not void ab initio because of the excess, but is good insofar as the power of the court extends, and is invalid only as to the excess.
Deagle v. Commonwealth, 214 Va. 304, 305, 199 S.E.2d 509, 510-11 (1973) (citations omitted).
In Deagle, the jury had four sentencing alternatives available. It chose two incompatible sentences. The Supreme Court concluded that “[c]ommon sense and reason dictate that the jury, if it had been required to choose between the two punishments it fixed, would have imposed the greater, the penitentiary sentence, and not the lesser, the fine.” Id. at 306, 199 S.E.2d at 511. It held that a trial court may substitute a lawful sentence for a sentence that is excessive by deleting the excessive portion of the invalid sentence. Id. See also Powell, 182 Va. at 340, 28 S.E.2d at 692 (a trial court may impose a valid sentence in substitution for a void one even though the defendant has begun serving the void sentence).
Dargan contends that this case is controlled by Hodges v. Commonwealth, 213 Va. 316, 191 S.E.2d 794 (1972). However, Hodges is legally and factually distinguishable. In explaining the inapplicability of Hodges to the situation presented by this case, the Supreme Court in Deagle said:
In both Hodges v. Commonwealth, 213 Va. 316, 191 S.E.2d 794 (1972), and Huggins v. Commonwealth, 213 Va. 327, 191 S.E.2d 734 (1972), the penalty fixed by the jury was death. After Furman v. Georgia, 408 U.S. 238 [92 S.Ct. 2726, 33 L.Ed.2d 346] (1972), which rendered the sentences pronounced on those verdicts invalid, we declined to summarily reduce the death sentences of Hodges and Huggins to life imprisonment as urged by the Attorney General. For, as we noted in Hodges,
“... it would be sheer speculation for us to conclude that, if death had not been a permissible punishment, the jury would have fixed the punishment at life imprisonment. The *499jury might well have agreed upon 99 years, as it did in the Ferguson murder”.
But the speculative element which was present in Huggins and Hodges is not present here.
From the verdicts we know that the jury intended that Deagle be sentenced to serve ten years in the penitentiary on each indictment.
Id. at 306, 199 S.E.2d at 511 (quoting Hodges, 213 Va. at 321, 191 S.E.2d at 797).
The alternative sentences available in Hodges fell into three categories: (1) death, (2) life imprisonment, and (3) imprisonment for a term of years. The unavailability of sentencing in one category did not render either other category the automatic choice. In this case, the sentence imposed by the jury fell within a single classification, a term of years. The correct sentence imposed by the trial court fell within that classification and, indeed, was encompassed within the sentence imposed by the jury. By imposing a ten-year term, the jury unquestionably intended that Dargan should serve at least five years. Therefore, Deagle controls this case and the trial court did not err in conforming the sentence to a term permitted by law.
Dargan contends that the modification of his sentence by the trial court violated his constitutional right to have a jury fix his sentence. We find no merit in this argument. Dargan was tried and convicted by a jury which imposed upon him the sentence that he now serves.
The judgment of the trial court is affirmed.
Affirmed.