
566 S.W.2d 871 (1978)
STATE of Tennessee, Petitioner,
v.
William Lee BURKHART, Respondent.
Supreme Court of Tennessee.
May 30, 1978.
Rehearing Denied July 10, 1978.
*872 John F. Southworth, Jr., Asst. Atty. Gen., Brooks McLemore, Jr., Atty. Gen., Nashville, for petitioner.
Hughie Ragan, Jackson, for respondent.

OPINION
COOPER, Justice.
We granted certiorari in this case to review a decision by the Court of Criminal Appeals holding that a trial judge who has imposed a sentence at variance with an express statutory mandate may not correct the sentence to conform to the statute after the judgment has become final.
From the allegations in and exhibits to the pleadings, it appears that the respondent, William Lee Burkhart, was convicted of burglary in the first degree, and sentenced to a term of twelve and one-half to fifteen years. While his appeal of that conviction was pending, he was confined in the Fort Pillow State Farm in Lauderdale County. He escaped from that institution on May 9, 1975, and was recaptured on May 27th. On October 10, 1975, in the Circuit Court of Lauderdale County, the respondent pled guilty to escape, and was sentenced to one year imprisonment. Although the judgment is not in the record, it appears that it provided that the sentence for the escape conviction would begin on that date, with credit for the time the respondent had spent in jail since his recapture. This had the effect, whether intended or not, of making the sentence for escape run concurrently with that for burglary. The respondent's burglary conviction was affirmed on appeal on June 28, 1976, and he was confined in the penitentiary. Some time thereafter, it appears that the Supervisor of Resident Records at the State Department of Correction informed the respondent that, under the provisions of T.C.A. § 39-3802, it was mandatory that his sentence for escape be served at the expiration of his sentence for burglary, and that his records were being adjusted accordingly. T.C.A. § 39-3802 provides, in pertinent part, as follows:
If any inmate ... shall escape or attempt to escape, he shall be indicted for an escape, and on conviction, be punished by imprisonment in the penitentiary for a term of one (1) to five (5) years to commence from and after the expiration of the original term.
The respondent then filed a pro se petition with the Circuit Court of Lauderdale County, asking that the trial judge order the Supervisor of Resident Records to set the sentences to run concurrently, as originally provided. The trial judge, noting the provisions of T.C.A. § 39-3802, dismissed the petition without a hearing. On appeal, the Court of Criminal Appeals reversed, with one judge dissenting. The majority of the court held that, although the October, 1975, judgment was erroneous as being contrary to the express provisions of T.C.A. § 39-3802, the trial judge could not correct it after it had become final.
*873 In holding as it did, the court below relied on Stinson v. State, 208 Tenn. 159, 344 S.W.2d 369 (1961). That reliance was misplaced. In Stinson, the court correctly refused to alter a judgment that, although incorrect, was in conformity with the applicable statutes and had become final. We are not faced with that situation here, for in the instant case the judgment entered in the trial court on October 10, 1975, was in direct contravention of the express provisions of T.C.A. § 39-3802, and consequently was a nullity. As a general rule, a trial judge may correct an illegal, as opposed to a merely erroneous, sentence at any time, even if it has become final. See, e.g., In re Sandel, 64 Cal.2d 412, 50 Cal. Rptr. 462, 412 P.2d 806 (1966); State v. Shilinsky, 248 Iowa 596, 81 N.W.2d 444 (1957); State v. Fountaine, 199 Kan. 434, 430 P.2d 235 (1967); State v. Culver, 23 N.J. 495, 129 A.2d 715 (1957); State v. Leathers, 271 Or. 236, 531 P.2d 901 (1975): Frazier v. Langlois, 103 R.I. 607, 240 A.2d 152 (1968); 168 A.L.R. 706, 719. Thus, the trial judge in the instant case had both the power, and the duty, to correct the judgment of October 10, 1975, as soon as its illegality was brought to his attention.
However, that determination alone does not dispose of the case. The respondent alleged in pleadings in the trial court that he had pled guilty to the escape charge as the result of a plea bargain, one of the terms of which was that the sentence for escape and that for burglary would be served concurrently. If true, the respondent would be entitled to withdraw his plea of guilty to escape, and to proceed to trial on that charge. See Henderson v. State, 220 Tenn. 520, 419 S.W.2d 176 (1967). Accord, Application of Tinsley, 178 Cal. App.2d 15, 2 Cal. Rptr. 642 (1960). But see State v. Loux, 69 Wash.2d 855, 420 P.2d 693 (1966). However, as the trial judge did not hold a hearing on this question, we cannot resolve it on the record before us. We therefore remand the case to the trial court, with directions that a hearing be held on the issues raised by the respondent.
On remand, the trial court should note that, at present, the respondent's sentence as imposed by the October 10, 1975, order is still in effect according to its original terms. The Department of Correction may not alter the judgment of a court, even if that judgment is illegal. See In re Sandel, 64 Cal.2d 412, 50 Cal. Rptr. 462, 412 P.2d 806 (1966). Furthermore, while, as we noted above, the trial court does have the power to correct the judgment of October 10, 1975, its order merely dismissing the respondent's petition was ineffective to do so.
The judgment of the Court of Appeals is reversed, and the case is remanded to the trial court for further proceedings consistent with this opinion.
HENRY, C.J., FONES and HARBISON, JJ., and QUICK, Special Justice, concur.
