
679 So.2d 1158 (1996)
Charles W. LEE, Petitioner,
v.
STATE of Florida, Respondent.
No. 86531.
Supreme Court of Florida.
June 27, 1996.
Rehearing Denied September 24, 1996.
Charles W. Lee, Lake City, Petitioner pro se.
Robert A. Butterworth, Attorney General; James W. Rogers, Tallahassee Bureau Chief, Criminal Appeals and Thomas Falkinburg, *1159 Assistant Attorney General, Tallahassee, for Respondent.
HARDING, Justice.
We have for review a decision passing upon the following question certified to be of great public importance:
WHETHER THE TRIAL COURT'S FAILURE TO CONSIDER A DEFENDANT FOR CLASSIFICATION AS A YOUTHFUL OFFENDER IS COGNIZABLE UNDER RULE 3.800(a), FLORIDA RULES OF CRIMINAL PROCEDURE.
Lee v. State, 667 So.2d 253 (Fla.App. 1st DCA 1995). We have jurisdiction. Art. V, § 3(b)(4), Fla. Const.
The First District Court of Appeal affirmed the trial court's order denying Lee's 3.800(a) motion[1] to correct an illegal sentence. Lee claimed that his sentence was illegal because the trial judge improperly refused to classify him as a youthful offender. For the reasons expressed below, we approve the decision of the district court.
On August 3, 1981, Lee pleaded guilty to second-degree murder and was sentenced to 120 years in prison. Because the offense occurred on November 18, 1980, when he was seventeen years old, Lee argued that he should have been classified as a youthful offender under section 958.04(2), Florida Statutes (1979).[2] After the circuit court denied his motion to correct an illegal sentence, he appealed to the First District Court of Appeal.
The district court found that the 1980 version of section 958.04(2) applied in Lee's case, which only mandated consideration of the criteria contained in the statute.[3] It did not mandate that every defendant to whom it applied be sentenced as a youthful offender.
The district court did, however, question the trial court's finding that because Lee was convicted of a "life felony," he was not even eligible for consideration under the youthful offender statute. The district court found that although second-degree murder was punishable under section 782.04(2), Florida Statutes (Supp.1980), by prison term "not exceeding life," this does not mean that it is a life felony for chapter 958 purposes.
The district court affirmed Lee's sentence under Davis v. State, 661 So.2d 1193 (Fla. 1995), where this Court held that a sentence is only illegal if it exceeds the maximum prescribed by law. However, the court recognized that Davis was not completely on point, since Davis concerned a departure from the sentencing guidelines not supported by written reasons, and Lee's case concerns a trial court's refusal to consider a defendant for youthful offender treatment based on the erroneous conclusion that he was ineligible for such classification. Consequently, the *1160 district court certified the question at issue to this Court.
The district court correctly recognized that Lee's reliance on section 958.04(2), Florida Statutes (1979), is misplaced. Lee's crime was committed on November 18, 1980; the effective date of section 958.04, Florida Statutes (Supp.1980), was October 1, 1980. Ch. 80-321, § 1, at 1388, Laws of Fla. It is clear that under the 1980 version, the judge was only required to consider whether or not to sentence a defendant meeting the statutory requirements as a youthful offender, using the enumerated factors. § 958.04, Fla.Stat. (Supp.1980).
In Davis, we said that "the failure to file contemporaneous written reasons for a departure sentence that is within the maximum period provided by law may not be raised as error for the first time in a collateral relief proceeding." Davis, 661 So.2d at 1194. Thus, a sentence is only "illegal" for 3.800(a) purposes if it is outside the maximum prescribed by law. Id.; see also State v. Callaway, 658 So.2d 983 (Fla.1995). Although Lee's sentence exceeds the maximum prescribed for youthful offenders, it does not exceed the maximum prescribed for second-degree murder.
While the trial judge's failure to consider section 958.04 in sentencing Lee may have been error, it would have been error which was cognizable on direct appeal. Rule 3.800(a) is not intended to correct errors of this nature. It is, by its plain language, a vehicle for correcting an illegal sentence. Because the error was cognizable on direct appeal, and because the judge possessed the discretion to refuse to classify Lee as a youthful offender even if he had considered section 958.04, his failure to consider the statute does not make the sentence "illegal" under our interpretation of that term in Davis. Thus, a rule 3.800(a) motion is not proper here.
For the reasons expressed above, we answer the certified question in the negative and approve the decision of the district court.
It is so ordered.
KOGAN, C.J., and OVERTON, SHAW, GRIMES, WELLS and ANSTEAD, JJ., concur.
NOTES
[1]  Florida Rule of Criminal Procedure 3.800(a) provides that "A court may at any time correct an illegal sentence imposed by it or an incorrect calculation made by it in a sentencing guideline scoresheet." Fla.R.Crim.P. 3.800(a).
[2]  Section 958.04, Florida Statutes (1979), provides:

Eligibility for youthful offender; classification.
(1) The court may classify as a youthful offender any person:
(a) Who is at least 18 years of age or who has been transferred for prosecution to the criminal division of the circuit court pursuant to chapter 39;
(b) Who is found guilty of or who has tendered, and the court has accepted, a plea of nolo contendere or guilty to a crime which is, under the laws of this state, a felony of the first, second, or third degree if such crime was committed before the defendant's 21st birthday; and
(c) Who has not previously been classified a youthful offender under the provisions of this act; however, no person who has been found guilty of a capital or life felony may be classified a youthful offender under this act.
(2) A person shall be classified a youthful offender if such person meets the criteria of subsection (1) and such person:
(a) Has not previously been found guilty of a felony, whether or not the adjudication of guilt has been withheld; or
(b) Has not been adjudicated delinquent for an act which would be a capital, life, or first degree felony if committed by an adult.
§ 958.04, Fla.Stat. (1979).
[3]  The 1980 version of section 958.04(2) contains discretionary language: "The following criteria shall be considered in determining whether to classify as a youthful offender a person who meets the requirements of subsection (1)...." § 958.04(2), Fla.Stat. (Supp.1980).
