
892 P.2d 202 (1995)
Clyde SMITH, Appellant,
v.
STATE of Alaska, Appellee.
No. A-5186.
Court of Appeals of Alaska.
March 31, 1995.
*203 Wally Tetlow, Asst. Public Defender, and John B. Salemi, Public Defender, Anchorage, for appellant.
Phil Moberly, Asst. Dist. Atty., Edward E. McNally, Dist. Atty., Anchorage, and Bruce M. Botelho, Atty. Gen., Juneau, for appellee.
Before BRYNER, C.J. and COATS and MANNHEIMER, JJ.

OPINION
MANNHEIMER, Judge.
In 1991, Clyde Smith pleaded guilty to third-degree misconduct involving a controlled substance (sale of cocaine), AS 11.71.030(a)(1), and first-degree misconduct involving weapons (being a felon-in-possession of a concealable firearm), AS 11.61.200(a)(1). As a second-felony offender, Smith was subject to a 4-year presumptive term for the sale of cocaine. AS 11.71.030(c) and AS 12.55.125(d)(1). The superior court found both aggravating and mitigating factors. After considering these factors, the court sentenced Smith to 6 years with 2 years suspended (4 years to serve). The court imposed a concurrent sentence for the felon-in-possession offense. (This court affirmed Smith's sentence in Smith v. State, Memorandum Opinion No. 2572 (Alaska App., December 9, 1992).)
Smith's present appeal concerns the calculation of this sentence. At the time he was sentenced, Smith had spent 266 days in jail. Superior Court Judge Milton M. Souter declared that Smith should receive credit against his sentence for these 266 days. The State objected, pointing out that Smith had not been arrested for his present offenses, but rather for violating his parole from his prior felony. The State argued that, since Smith was going to be credited with these 266 days in his prior felony, he should not receive another 266-day credit in his present case. Judge Souter disagreed, ruling that Smith should receive the 266-day credit in both cases.
This ruling was incorrect. By law, Smith's sentence in the present case had to run consecutively to his sentence from his previous felony. AS 12.55.025(e); Jennings v. State, 713 P.2d 1222 (Alaska App. 1986). This being so, Smith's 266 days in jail could be applied against only one of these sentences. Endell v. Johnson, 738 P.2d 769 (Alaska App. 1987).
When the Department of Corrections refused to give Smith double credit for the 266 days, Smith filed a motion seeking a reduction of his sentence. He recognized that he was not entitled to receive double credit for the 266 days, but he argued that his period of incarceration was now going to be 266 days longer than Judge Souter originally intended. Judge Souter denied Smith's motion. He reasoned that Smith's sentence must remain unaltered because (1) his original order giving double credit for time served had been illegal, and (2) Smith's prison sentence in the present case was presumptive and could not be reduced. Following this ruling, Smith attacked his sentence on constitutional grounds, asserting that Judge Souter's refusal to modify the sentence was, in effect, an illegal increase in the sentence. Judge Souter denied Smith's motions.
Smith now appeals Judge Souter's rulings. We reverse.
If a defendant's sentence is illegal, it has not been "meaningfully imposed" for double jeopardy purposes, and it can be corrected even if this means increasing the severity of the sentence. Dunham v. Juneau, 790 P.2d 239, 240-41 (Alaska App. 1990); State v. LaPorte, 672 P.2d 466, 468-69 & n. 6 (Alaska App. 1983); 3 Charles Wright, Federal Practice and Procedure: Criminal (2nd ed. 1982), § 582, pp. 380-89. However, the *204 illegal sentence can be modified only to the extent necessary to correct the illegality. Christensen v. State, 844 P.2d 557, 558 (Alaska App. 1993); Curtis v. State, 831 P.2d 359 (Alaska App. 1992); Love v. State, 799 P.2d 1343, 1346-47 (Alaska App. 1990); Joseph v. State, 712 P.2d 904, 906 (Alaska App. 1986).
The illegality in this case is that, under the sentence as it was originally imposed, Smith received 266 days' credit against both the sentence for his present crime and the sentence for his previous crime. If this illegality were corrected without any other adjustment of Smith's sentence, Smith would spend more time in jail than Judge Souter originally announced. Apprised of this problem, Judge Souter refused to adjust Smith's 4-year sentence because he believed it to be unalterable under the presumptive sentencing laws. However, when sentencing Smith in the present case, the superior court found that Smith had proved a mitigating factor. The presence of this mitigating factor allowed the court to adjust Smith's presumptive term downward. AS 12.55.155(a)(1). Judge Souter thus had the authority to reduce Smith's sentence to take into account the extra time Smith would spend in prison now that the 266 days were going to be counted only once.
Because Judge Souter had the authority to correct the illegality in Smith's original sentence without increasing Smith's time to serve, he should have granted Smith's motion and adjusted Smith's sentence accordingly. The judgment of the superior court is REVERSED. This case is remanded to the superior court with directions to amend Smith's sentence in conformity with this opinion.
