
895 P.2d 1046 (1995)
Yale DOWNING, Petitioner,
v.
The PEOPLE of the State of Colorado, Respondent.
No. 94SC119.
Supreme Court of Colorado, En Banc.
May 15, 1995.
*1048 David F. Vela, Colorado State Public Defender, and Karen M. Gerash, Deputy State Public Defender, Denver, for petitioner.
Gale A. Norton, Atty. Gen., Stephen K. ErkenBrack, Chief Deputy Atty. Gen., Timothy M. Tymkovich, Sol. Gen., John Daniel Dailey, Deputy Atty. Gen., Robert Mark Russel, First Asst. Atty. Gen., and Paul Koehler, Asst. Atty. Gen., Denver, for respondent.
Justice KIRSHBAUM delivered the Opinion of the Court.
The petitioner, Yale Downing, filed a motion pursuant to Crim.P. 35(a), challenging the validity of a seven-year sentence to the Department of Corrections imposed upon him by the trial court as a result of the court's determination that Downing should be transferred from a community corrections facility. Downing alleged that the trial court exceeded its jurisdiction in imposing a seven-year sentence because such sentence was in excess of a six-year sentence earlier imposed on Downing. The trial court denied the motion, and in People v. Downing, No. 92CA1228 (Colo.App. Dec. 23, 1993) (not selected for publication), the court of appeals affirmed. Having granted certiorari to review the propriety of the court of appeals' decision, we reverse and remand with directions.

I
On January 2, 1991, Downing was sentenced by the trial court to a term of six years in the custody of the Department of Corrections as the result of his plea of guilty to the offense of sexual assault on a child.[1] Downing subsequently filed a motion for reconsideration of sentence pursuant to Crim.P. 35(b), requesting transfer to a community corrections facility. After conducting a hearing, the trial court granted the motion, vacated the prior sentence, and on July 8, 1991, entered a judgment of conviction and mittimus sentencing Downing to a community corrections facility for a term of eight years, nunc pro tunc to January 2, 1991.
On April 8, 1992, the People filed a motion with the trial court pursuant to section 17-27-114(1), 8A C.R.S. (1986),[2] to terminate Downing's sentence to a community corrections facility and to transfer him to the custody of the Department of Corrections. The motion alleged generally that Downing had violated the terms and conditions of his sentence by conduct including unauthorized absence, menacing, and escape. A hearing on the motion was conducted on May 21, 1992, at the conclusion of which the trial court granted the motion and resentenced Downing to the custody of the Department of Corrections for a term of seven years. Downing was awarded a credit of 368 days against the sentence for time served.
Downing subsequently filed a motion for reconsideration of illegal sentence pursuant to Crim.P. 35(a). He alleged that the trial court lacked authority to impose a sentence in excess of the six-year sentence imposed on January 2, 1991. The trial court denied the *1049 motion, and on appeal the court of appeals affirmed the trial court's ruling.

II
The trial court sentenced Downing to a community corrections facility on July 8, 1991, pursuant to section 17-27-114(1), 8A C.R.S. (1986). That statute provides, inter alia, that an offender sentenced to a community corrections facility must comply with the rules and regulations of the facility. Id. It also provides that an offender who violates any of those rules or regulations may be transferred to the Department of Corrections following a transfer hearing. § 17-27-114(1), (2), 8A C.R.S. (1986). However, in resentencing such an offender the trial court is prohibited from "increasing the length of the original sentence." § 17-27-114(2), 8A C.R.S. (1986).
Downing asserts that the six-year sentence imposed January 2, 1991, was the original sentence for purposes of section 17-27-114(2), 8A C.R.S. (1986), and that the trial court therefore exceeded its jurisdiction in imposing a seven-year sentence on May 21, 1992. The People contend that because Downing's initial six-year sentence was subsequently vacated, the eight-year sentence imposed on July 8, 1991, must be deemed Downing's original sentence for purposes of the statute. We agree with Downing's argument.
Crim.P. 35(b) contains the following pertinent provisions:
The court may reduce the sentence provided that a motion for reduction of sentence is filed (1) within 120 days after the sentence is imposed, or (2) within 120 days after receipt by the court of a remittitur issued upon affirmance of the judgment of sentence or dismissal of the appeal, or (3) within 120 days after entry of any order or judgment of the appellate court denying review or having the effect of upholding a judgment of conviction or sentence. The court may, after considering the motion and supporting documents, if any, deny the motion without a hearing. The court may reduce a sentence on its own initiative within any of the above periods of time. Crim.P. 35(b). This rule authorizes a trial court to reduce an offender's original sentence. It does not authorize a trial court to increase such sentence unless the original sentence was erroneously imposed or is void. Smith v. Johns, 187 Colo. 388, 532 P.2d 49 (1975); People v. Nix, 44 Colo.App. 195, 610 P.2d 1088 (1980). A sentence imposed by a court that is not authorized by statute is illegal and void. People v. District Court, 673 P.2d 991, 995 (Colo.1984). The trial court's July 8, 1991, judgment of conviction increasing the length of Downing's original sentence from six years to eight years was not authorized by statute or by rule and was therefore void.
The People argue that a sentence to a community corrections facility is less harsh than a sentence to the Department of Corrections and that therefore the eight-year sentence imposed on June 27, 1991, should be deemed a reduction rather than an increase in Downing's sentence. However accurate the predicate for this argument might be, the conclusion is not warranted.
The conditions of confinement at a community corrections facility admittedly are in many respects less severe than the conditions of confinement in a penal institution. The rehabilitative programs of community corrections facilities afford opportunities to offenders for participation in activities away from the facility. Nonetheless, as we observed in People v. Hoecher, 822 P.2d 8, 12 (Colo.1991), "[a]n offender sentenced to a community correctional facility is confined in a very real sense during the period of time in which the offender remains on residential status." Offenders transferred from a community corrections facility to the Department of Corrections are entitled to credit for time served as residents in the community corrections facility. Id. at 12. Furthermore, time served as a resident of a community corrections facility is considered equivalent to time served at the Department of Corrections for the purposes of sentencing. Id.; People v. Saucedo, 796 P.2d 11, 12 (Colo.App.1990). It would be illogical to grant an offender who is transferred to the Department of Corrections credit for each day served as a resident of a community corrections facility, but nevertheless *1050 subject an offender transferred to a community corrections facility from the Department of Corrections to a more lengthy term of confinement than originally imposed.
While conditions of confinement no doubt vary dramatically depending on the nature of the custodial institution, the length of time during which a person is subject to institutional custody is the primary measure of the harshness of any particular sentence. The provisions of Crim.P. 35(b) authorize reductions in sentences, not reductions in the terms and conditions of sentences. A term of imprisonment that is longer than a term of imprisonment previously imposed constitutes an increase in the sentence for purposes of Crim.P. 35(b), regardless of where the sentence is to be served or what the conditions of the institution might be. See People v. Washington, 709 P.2d 100 (Colo.App.1985); People v. Johnson, 42 Colo.App. 350, 594 P.2d 601 (1979). The eight-year sentence imposed on Downing on July 8, 1991, constituted an increase, not a reduction, of his original sentence, and is therefore void.
The People also argue that because Downing did not object to the imposition of the eight-year sentence at the hearing on his Crim.P. 35(b) motion he waived his right to challenge its legality. We disagree. Crim.P. 35(a) authorizes a trial court to correct an illegal sentence "at any time." Crim.P. 35(a). Allegations that a particular sentence is void or illegal require inquiry into the subject matter jurisdiction of the sentencing court and may not be waived. See, e.g., Lee v. Colorado Dept. of Health, 718 P.2d 221, 225 (Colo.1986). For this reason, Downing's challenge to the validity of the eight-year sentence imposed upon him on July 8, 1991, is not foreclosed by the procedural posture of the case. People v. Bradley, 169 Colo. 262, 455 P.2d 199 (1969); People v. Perkins, 676 P.2d 711, 713 (Colo.App.1983).

III
For the foregoing reasons, we conclude that the trial court exceeded its jurisdiction in sentencing Downing to the custody of the Department of Corrections for a term of seven years on May 21, 1992, because such sentence was in excess of Downing's original six-year sentence. We therefore reverse the judgment of the court of appeals and remand the case to that court with directions to return the case to the trial court for resentencing consistent with this opinion.
NOTES
[1]  § 18-3-405, 8B C.R.S. (1986).
[2]  Section 17-27-114 provides in pertinent part as follows:

Confinement in county jailresentencing. (1) Where the administrator of a community correctional facility or any other appropriate supervising authority has cause to believe that an offender placed in a community correctional facility has violated any rule or condition of his placement in that facility ... the administrator or other authority shall certify to the appropriate judicial ... authority the facts which are the basis for his belief and execute a transfer order to any [appropriate officer] to transport the offender to the county jail in the county in which the facility is located where he shall be confined pending a determination by the appropriate court ... as to whether or not the offender shall remain in community corrections....
(2) If the sentencing court determines that the offender shall not remain in community corrections, the court is authorized to make appropriate orders for the transfer of such offender and impose any sentence which might originally have been imposed without increasing the length of the original sentence.
§ 17-27-114, 8A C.R.S. (1986).
The substantive provisions of this article were repealed and reorganized, effective July 1, 1993. Act approved May 6, 1993, ch. 187, sec. 1, 1993 Colo.Sess.Laws 708. The relevant provisions of the former statute remain substantially unchanged in the current statute. See § 17-27-105, 8A C.R.S. (1994 Supp.).
