
698 So.2d 1345 (1997)
STATE of Florida, Appellant,
v.
Joseph L. MOTEN, Appellee.
No. 96-1206.
District Court of Appeal of Florida, Fifth District.
September 12, 1997.
*1346 Robert A. Butterworth, Attorney General, Tallahassee, and Anthony J. Golden, Assistant Attorney General, Daytona Beach, for appellant.
James Dickson Crock of James Dickson Crock, P.A., Daytona Beach, for appellee.
THOMPSON, Judge.
The State of Florida appeals an order granting Joseph Moten's motion to correct an illegal sentence filed pursuant to Florida Rule of Criminal Procedure 3.800(a), and setting aside Moten's conviction and sentence. We reverse.
Joseph L. Moten was charged with selling a controlled substance within 200 feet of a public park, a first degree felony in violation of section 893.13(1)(i)(1), Florida Statutes (1991). On 21 August 1991, Moten entered a negotiated plea to seven years incarceration in return for the state's agreement not to seek habitualization. Moten was sentenced accordingly on 13 September 1991. The court entered a judgment of conviction on the charge of selling a controlled substance within 200 feet of a public park. Moten did not appeal, but later filed numerous motions for post-conviction relief seeking clarification of his sentence. His only argument was that the Department of Corrections was treating his seven year sentence as a minimum mandatory sentence. In his current motion, filed on 16 February 1996, pursuant to rule 3.800, Florida Rules of Criminal Procedure, Moten alleged that he had pleaded guilty to sale of a controlled substance within 200 feet of a public housing facility rather than to sale of a controlled substance within 200 feet of a public park. Indeed, at the plea hearing the prosecutor at one point misstated the charge to the trial court. Moten agreed to plead "in docket number 91-3608 to sale of cocaine within 200 feet of a public housing project...." No objection was made to the misstatement at the time.
After hearing legal argument on Moten's current motion, the court entered an "amended `Corrected'" judgment which adjudicated Moten guilty of sale of a controlled substance "in front of" a public housing facility. Then, based on Brown v. State, 629 So.2d 841 (Fla.1994), which held that the term "public housing facility" was vague, and Paige v. State, 641 So.2d 179 (Fla. 5th DCA 1994), which held that a person improperly convicted of sale of a controlled substance within 200 feet of a public housing facility should be convicted on remand of the lesser included offense of sale of a controlled substance, the court entered in effect a second amended judgment reflecting a conviction for sale of a controlled substance. In addition, the court resentenced Moten to four and one-half years to reflect the lesser conviction.
We agree with the state that the court improperly granted relief in this case. First, a 3.800 motion cannot be used to obtain relief from a judgment. See Sanders v. State, 621 So.2d 723 (Fla. 5th DCA 1993), rev. denied, 629 So.2d 135 (Fla.1993); State v. Spella, 567 So.2d 1051 (Fla. 5th DCA 1990). As the procedure used below makes apparent, Moten's claim is actually an attack on his conviction and thus is not cognizable under rule 3.800. See Sanders; Spella. Further, rule 3.800(a) is reserved for a narrow category of cases in which the sentence is truly illegal as a matter of law. Judge v. State, 596 So.2d 73, 77 (Fla. 2d DCA 1991), rev. denied, 613 So.2d 5 (Fla.1992). Moten was not entitled to relief because his sentence, which was within the statutory maximum, was not illegal. An illegal sentence for purposes of Rule 3.800(a) is one which exceeds the statutory maximum. See State v. Callaway, 658 So.2d 983 (Fla.1995); Davis v. State, 661 So.2d 1193 (Fla.1995). Moten was originally sentenced to seven years in prison which is substantially less than the maximum penalty for a first degree felony. See § 775.082(3)(b), Fla. Stat. (1991). Accordingly, we vacate the 17 April 1996 judgments and sentence and reinstate the original judgment and sentence.
JUDGMENTS and SENTENCE VACATED; original JUDGMENT and SENTENCE REINSTATED.
COBB and HARRIS, JJ., concur.
