
598 So.2d 135 (1992)
Ronald Scott HAYES, Appellant,
v.
STATE of Florida, Appellee.
No. 91-2067.
District Court of Appeal of Florida, Fifth District.
April 17, 1992.
*136 Ronald Scott Hayes, Lowell, pro se.
Robert A. Butterworth, Atty. Gen., Tallahassee, and Anthony J. Golden, Asst. Atty. Gen., Daytona Beach, for appellee.
COWART, Judge.
Pursuant to a no contest plea and a plea agreement the defendant was sentenced as an habitual offender to 50 years imprisonment for an armed robbery offense, 50 years imprisonment for an armed kidnapping offense, 10 years imprisonment for an aggravated assault offense and 10 years imprisonment for a grand theft auto offense; all sentences to run concurrently. This court per curiam affirmed the convictions and sentences in Hayes v. State, 568 So.2d 446 (Fla. 5th DCA 1990).
The defendant, pro se, has now filed a second 3.850 motion raising some matters not now cognizable by this court but the motion does raise one issue we are compelled to address.

THE SUBSTANTIVE PROBLEM  AN ILLEGAL SENTENCE
Section 812.13(2)(a), Florida Statutes, provides that armed robbery is a felony of the first degree punishable by imprisonment for a term of years not exceeding life. However, pursuant to section 787.01(2), Florida Statutes, kidnapping is punishable by imprisonment for a term of years not exceeding life and, when committed with a firearm, is enhanced to a life felony pursuant to section 775.087(1)(a), Florida Statutes. See, e.g., Newton v. State, 581 So.2d 212 (Fla. 4th DCA 1991), approved, 594 So.2d 306 (Fla. 1992). The habitual offender statute is inapplicable to life felonies but permits enhancement of first degree felonies punishable by imprisonment of a term of years not exceeding life. § 775.084, Fla. Stat. Burdick v. State, 594 So.2d 267 (Fla. 1992); Harris v. State, 586 So.2d 1350 (Fla. 1st DCA 1991), approved, 594 So.2d 272 (Fla. 1992); Sheffield v. State, 585 So.2d 396 (Fla. 1st DCA 1991), approved, 595 So.2d 37 (Fla. 1992); Lock v. State, 582 So.2d 819 (Fla. 2d DCA 1991), approved, 595 So.2d 50 (Fla. 1992); Newton; Tucker v. State, 576 So.2d 931 (Fla. 5th DCA 1991), approved, 595 So.2d 956 (Fla. 1992); Westbrook v. State, 574 So.2d 1187 (Fla. 3d DCA 1991), approved, 595 So.2d 50 (Fla. 1992); Paige v. State, 570 So.2d 1108 (Fla. 5th DCA 1990) and Young v. State, 600 So.2d 24 (Fla. 3d DCA 1992).
The application of the habitual offender statute to the armed robbery charge was proper but the application of the statute was not proper as to the armed kidnapping charge. See Paige. A sentence is not illegal where a defendant received a legal sentence that was the condition of the plea bargain. State v. Lindsey, 560 So.2d 406 (Fla. 5th DCA 1990). However, 50 years is not a legal sentence for a life felony committed after October 1, 1983. Section 775.082(3)(a), Florida Statutes, states that for a life felony committed prior to October 1, 1983, the defendant may be sentenced to a term of imprisonment for life or to a term of years not less than 30 and for a life felony committed on or after October 1, 1983, a defendant may be sentenced to a "term of imprisonment for life or by a term of imprisonment not exceeding 40 years."
In Salas v. State, 589 So.2d 343 (Fla. 4th DCA 1991), in an appeal of the denial of a Rule 3.850 motion, the defendant claimed he had received illegal sentences exceeding the statutory maximum allowable by law because he received a 99 year prison term for each of four counts of sexual battery *137 and two counts of kidnapping. The district court agreed and reversed as to the sexual battery offenses. The court held that the sexual battery aggravated by the use of a weapon was a life felony which was committed after October 1, 1983, and thus the total sentence could not exceed 40 years. The court held that for offenses committed after October 1, 1983, once the trial court sentences a defendant under section 775.082(3)(a), Florida Statutes, to a term of years as opposed to a term of imprisonment for life, the term of years cannot exceed 40. See also, Ward v. State, 558 So.2d 166 (Fla. 1st DCA 1990); Spivey v. State, 526 So.2d 762 (Fla. 2d DCA 1988). As the unarmed kidnapping offense was a first degree felony punishable by imprisonment for a term of years not exceeding life, the court held the 99 year sentence was proper.

THE PROCEDURAL PROBLEM
Part of the problem in this case appears to result from the fact, now not correctable, that (1) the case proceeded strictly on the plea agreement, (2) no adequate factual basis for the plea was established pursuant to Florida Rule of Criminal Procedure 3.172, (3) a presentence investigation report was waived, and (4) the original record on appeal did not disclose the date of the offense or a guidelines scoresheet. Further, the defendant is confined and acting as his own counsel.
The first procedural problem is that the original record on appeal did not clearly show whether the armed kidnapping offense occurred before or after October 1, 1983, the date crucial to a lawful sentence and a correct decision in this case. However, in the circumstance where, as in this case, a particular sentence is lawful if the crime occurred before a certain date and unlawful if it occurred after that date, the burden is not on the defendant on review of the denial of a 3.850 motion to show that the crime occurred after the crucial date. The burden is on the State to present a record on appeal that affirmatively shows the crime occurred before the crucial date because constitutional due process in criminal cases and Florida rules of procedure put, and keep, the burden on the State to make and maintain a record that affirmatively shows that the conviction and sentence are lawful.[1]
The next procedural problem arises from the fact that the defendant's habitual offender sentence was imposed prior to his previous appeal and it can be said that the issue as to its illegality could or should have been raised on direct appeal and many cases[2] have stated that Florida Rule of Criminal Procedure 3.850 cannot be used to review issues which could or should have been raised on direct appeal. However, those cases do not involve an illegal sentence which can be corrected at any time,[3] as it should be.
An illegal sentencing error can be raised under Rule 3.850 even if that issue could have been raised on a prior appeal. See Reynolds v. State, 429 So.2d 1331, 1333 (Fla. 5th DCA 1983), stating:

*138 It is true that this type of sentencing error could have been raised on direct appeal and, normally, that is a good ground for denying relief under 3.850, but not always. Where, as here, the sentencing error can cause or require a defendant to be incarcerated or restrained for a greater length of time than provided by law in the absence of the sentencing error, that sentencing error is fundamental and endures and petitioner is entitled to relief in any and every legal manner possible, viz: on direct appeal although not first presented to the trial court, by post-conviction relief under Rule 3.850, or by extraordinary remedy. As to such a fundamental sentencing error he is entitled to relief under an alternative remedy notwithstanding that he could have, but did not, raise the error on appeal.
Greenhalgh v. State, 582 So.2d 107 (Fla. 2d DCA 1991), presented the exact same substantive issue presented in this case, i.e., the habitual offender statute is inapplicable to life felonies, and in that case the court held that although the issue could have been litigated on plenary appeal, a sentence that exceeds the maximum allowed by statute constitutes fundamental error which can be raised at any time, citing Reynolds v. State. To the same effect, see Debose v. State, 580 So.2d 638 (Fla. 5th DCA 1991) and Yates v. State, 509 So.2d 1249 (Fla. 5th DCA 1987).
All persons in prison under a sentence for the commission of a crime are there because the judicial system declared they did not follow and obey the law but, to the contrary, they did an illegal act. Certainly in imposing the sanctions of the law upon a defendant for illegal conduct the judicial system itself must follow and obey the law and not impose an illegal sentence, and, when one is discovered, the system should willingly remedy it. The purpose of all criminal justice rules, practices and procedures is to secure the just determination of every case in accordance with the substantive law. While imperfect, our criminal justice system must provide a remedy to one in confinement under an illegal sentence. There is no better objective than to seek to do justice to an imprisoned person. Further, as a practical matter, if relief from this obviously illegal sentence is not now given in this case, the defendant will, and should, be able to obtain it in other ways, either by an ineffective assistance claim against his former counsel or by way of habeas corpus in a state or federal court. Courts should be both fair and practical and give relief as soon as it is recognized as due.
Finally, this court's decisions in State v. Spella, 567 So.2d 1051 (Fla. 5th DCA 1990) and Jolly v. State, 392 So.2d 54 (Fla. 5th DCA 1981), require a plea to be set aside in situations such as the instant one if the State so desires:
Therefore, in a situation involving a reduction of sentence in contravention of the plea bargain, the state should be given the option of either agreeing that both the judgment and sentence should be vacated and taking the defendant to trial on all original charges, or agreeing that only the excessive sentence should be vacated, while making the judgment stand and allowing the defendant to be resentenced... .
Jolly at 56.
We vacate the illegal sentence on the armed kidnapping offense and remand with instructions that the defendant be resentenced on that offense to a term not exceeding imprisonment for life or a term of imprisonment not exceeding 40 years unless, pursuant to Spella and Jolly, the State prefers that the judgments and sentences be vacated on all charges involved in the plea agreement and the defendant be tried on all original charges.
SENTENCE VACATED; CAUSE REMANDED WITH INSTRUCTIONS.
GOSHORN, C.J., and COBB, J., concur.
NOTES
[1]  Florida Rule of Appellate Procedure 9.140(g). The record on appeal does not show conclusively that the defendant is not entitled to relief (Rule 9.140(g)); on the contrary it affirmatively indicates he is entitled to relief from an illegal sentence. In addition the record on appeal has been supplemented and the three charging documents allege that the grand theft auto offense occurred on or about December 2, 1987, and all the other offenses were alleged to have occurred on August 1, 1989; all long after the October 1, 1983 date crucial under section 775.082(3)(a), Florida Statutes.
[2]  Adams v. State, 543 So.2d 1244 (Fla. 1989); Blanco v. Wainwright, 507 So.2d 1377 (Fla. 1987) Francis v. State, 529 So.2d 670 (Fla. 1988); McCrae v. State, 510 So.2d 874 (Fla. 1987); Armstrong v. State, 429 So.2d 287 (Fla. 1983), cert. denied, 464 U.S. 865, 104 S.Ct. 203, 78 L.Ed.2d 177 (1983); Smith v. State, 543 So.2d 316 (Fla. 5th DCA 1989); Gonzalez-Osorio v. State, 535 So.2d 644 (Fla. 2d DCA 1988), rev. denied, 544 So.2d 199 (Fla. 1989); DiSavoia v. State, 522 So.2d 84 (Fla. 2d DCA 1988), rev. denied, 529 So.2d 693 (Fla. 1988).
[3]  See Florida Rule of Criminal Procedure 3.800(a). An illegal sentence can be corrected under Rule 3.800 even when there has been an affirmance of the judgment and sentence on direct appeal and the issue has previously been raised on a 3.850 motion which was denied and never appealed. See Anderson v. State, 584 So.2d 1127 (Fla. 4th DCA 1991).
