The opinion of the court was delivered by
Rosen, J.:The State of Kansas appeals from an order by the district court that granted Amoneo D. Lee’s motion to correct an illegal sentence. Lee was convicted by a jury for a 1995 murder, and the judge imposed a life sentence without the possibility of parole for 40 years. The conviction was affirmed by this court in State v. Lee, 266 Kan. 804, 977 P.2d 263 (1999). The validity of the sentencing procedure was not raised in the direct appeal.
In 2008, Lee filed a motion “for correction of sentence pursuant to K.S.A. 22-3504(1),” alleging, inter alia, that the sentencing court denied him “his due process rights of allowing the jury to participate in the sentencing proceeding that was not waived by the defendant.” The district court summarily denied the motion. This court affirmed the judgment of the district court, relying on the then-current understanding of Apprendi v. New Jersey, 530 U.S. 466, 120 S. Ct. 2348, 147 L. Ed. 2d 435 (2000): Because the sentencing court did not enhance Lee’s maximum sentence but only his sentence relating to parole eligibility, the sentence did not violate his Sixth Amendment right to a jury trial. State v. Lee, No. 101,638, 2011 WL 433533 (Kan. 2011) (unpublished opinion).
On August 11, 2014, Lee filed through counsel a second motion *417to correct an illegal sentence, based on Alleyne v. United States, 570 U.S. _, 133 S. Ct. 2151, 186 L. Ed. 2d 314 (2013), and State v. Soto, 299 Kan. 102, 322 P.3d 334 (2014). Following a hearing, the district court granted Lees motion. It is this motion and order that is the subject of the current appeal.
Whether a sentence is illegal under K.S.A. 22-3504 is a question of law subject to de novo review. State v. Mitchell, 284 Kan. 374, 376, 162 P.3d 18 (2007).
At sentencing, the district court judge considered Lees three prior convictions of aggravated batteiy, as well as convictions of carrying concealed weapons, burglaries, and thefts. He also took into account the nature of the crime at hand and concluded: “Clearly the aggravating factors in this case, the prior conviction, the severity of it, those findings I’ve already made, clearly outweigh beyond a reasonable doubt any mitigating factor that exists in this case.” Based on this finding, the judge sentenced Lee to a life term without eligibility for parole for a minimum of 40 years. These determinations were made exclusively by the sentencing judge.
In granting Lees motion to correct the sentence, the Sedgwick County District Court agreed with him that the sentencing procedure violated Alleyne. The district court then held that retroactivity was not a relevant inquiiy, because it would be unfair to punish a defendant who was the victim of bad timing. The court then ordered that Lee be brought back into court for resentencing.
Under K.S.A. 22-3504(1), a defendant may file a motion to correct an illegal sentence at any time. An illegal sentence is a sentence imposed by a court without jurisdiction; a sentence that does not conform to the statutory provision, either in the character or the term of the punishment authorized; or a sentence that is ambiguous with respect to the time and manner in which it is to be served. Mitchell, 284 Kan. at 376. A sentence is illegal only if it fits within these categories. State v. Gayden, 281 Kan. 290, 293, 130 P.3d 108 (2006). A claim that a term of punishment was later declared unconstitutional does not satisfy the requirements for finding a sentence illegal. 281 Kan. at 292.
This court addressed that issue squarely in State v. Moncla, 301 Kan. 549, 553-54, 343 P.3d 1161 (2015), holding:
*418“Monda also argues that his sentence is illegal because a judge rather than a jury determined the existence and weight of the aggravating factor that led to the hard 40. He cites Alleyne v. United States, 570 U.S. _, 133 S. Ct. 2151, 2162-63, 186 L. Ed. 2d 314 (2013), which held that, under the Sixth Amendment, any fact that increased a sentence must be found by a jury rather than a judge. ‘Because the definition of an illegal sentence does not include a claim that the sentence violates a constitutional provision, a defendant may not file a motion to correct an illegal sentence based on constitutional challenges to his or her sentence.’ State v. Mitchell, 284 Kan. 374, 377, 162 P.3d 18 (2007); see Verge v. State, 50 Kan. App. 2d 591, 598-99, 335 P.3d 679 (2014) (motion to correct illegal sentence based on Alleyne improper constitutional challenge to sentence).”
See also State v. Warrior, 303 Kan. 1008, Syl., 368 P.3d 1111 (2016) (motion to correct illegal sentence inappropriate vehicle for challenges under Alleyne); State v. Noyce, 301 Kan. 408, 409-10, 343 P.3d 105 (2015) (Alleyne constitutional issues not proper basis for motion to correct illegal sentence); State v. Peirano, 289 Kan. 805, 217 P.3d 23 (2009) (failure of sentencing court to carry out statutorily mandated balancing of aggravating and mitigating factors did not render sentence illegal).
Lee seeks to frame his main argument as being something other than a constitutional challenge. As artfully crafted as his arguments are, they all seek application of later caselaw to the statute that was in effect at the time that he was sentenced. Lee was sentenced under a statute that did not, at the time, conflict with any higher court decision on the jury-determination question.
The statute, K.S.A. 22-3504, was not void at the time, because no court had held it to be void. Apprendi was not issued until June 2000, and Lee’s conviction, sentence, and appeal had become final by that time. The 1997 statute was not vacated as having no effect. See, e.g., Whisler v. State, 272 Kan. 864, 877-79, 36 P.3d 290 (2001) (Apprendi represented procedural, not substantive change and was not a “watershed rule” of ciiminal procedure implicating fundamental fairness of trial; could not be applied in collateral attacks on sentences). Whether the timing of subsequent decisions gives the appearance of “unfairness,” as the district court ruled, is irrelevant: Lee’s claim is inappropriate because a motion to correct an illegal sentence cannot be used to attack the constitutionality of a sentencing statute.
*419The decision of the district court granting the motion to correct an illegal sentence is reversed, and the order that Lee be resen-tenced is vacated.