
754 So.2d 64 (2000)
Ronald Wayne RICHARDSON, Petitioner,
v.
Michael W. MOORE, Secretary of Florida Department of Corrections, and State of Florida, Respondents.
No. 3D99-1703.
District Court of Appeal of Florida, Third District.
March 8, 2000.
Bennett H. Brummer, Public Defender, and Andrew Stanton, Assistant Public Defender, for petitioner.
Robert A. Butterworth, Attorney General, and M. Rebecca Springer, Assistant Attorney General, for respondents.
Before JORGENSON, COPE, and LEVY, JJ.
COPE, J.
Ronald Wayne Richardson petitions for writ of habeas corpus, contending that there has been a violation of the prohibition on ex post facto laws. See Fla. Const. Art. I, § 10 (1968). The State concedes that the point is well taken and that petitioner is entitled to relief.
Petitioner-defendant Richardson was charged with armed robbery, and attempted armed robbery. The offense date was August 4, 1989. In 1991, he entered into a plea agreement whereby his charges were reduced to robbery without a weapon and attempted robbery without a weapon. He was sentenced to jail time and probation.
As part of the plea, defendant agreed that he would be sentenced as a habitual violent felony offender (HVO) if he violated his probation. Thereafter, defendant violated probation, his probation was revoked, and defendant was sentenced as an HVO to twenty years with a ten-year minimum mandatory sentence for both counts.
It is evident that, at the time of defendant's plea in 1991, counsel and the court were under the impression that the case was governed by the 1989 version of the HVO statute. Under the 1989 statute, one of the qualifying HVO offenses was aggravated battery. See § 775.084(1)(b)1.k., Fla. Stat. (1989). On the basis of that *65 predicate offense, defendant was adjudicated an HVO. Defendant had no other qualifying HVO offenses.
In reality, however, the wrong statute was applied to the defendant. The defendant committed his crimes on August 4, 1989. The applicable version of the HVO statute was section 775.084, Florida Statutes (Supp.1988). Under the 1988 statute, aggravated battery was not a qualifying offense. The statute was amended effective October 1, 1989 to add aggravated battery as a qualifying offense, see ch. 89-280, § 1, Laws of Fla., but that was after the date of defendant's crime.[1]
Defendant argues, and the State concedes, that application of the 1989 HVO statute to defendant amounts to a violation of the prohibition against ex post facto laws. See Fla. Const. art. I, § 10 (1968). It is true that this court has held in Bover v. State, 732 So.2d 1187 (Fla. 3d DCA), review granted, No. 95,649 (Fla. Oct. 26, 1999), that a claim of factual error in the adjudication of a defendant as a habitual offender must be brought under Rule 3.850. We distinguish Bover, however, because in the case before us, the HVO adjudication violates the constitutional prohibition against ex post facto laws. The defendant is entitled to relief, either by habeas corpus or by treating the petition as a motion to correct illegal sentence under Florida Rule of Criminal Procedure 3.800(a). See Hopping v. State, 708 So.2d 263 (Fla.1998) (where sentence has been increased after imposition in violation of double jeopardy clause, the sentence is illegal and correctable under Florida Rule of Criminal Procedure 3.800).
The next issue is what remedy to apply given the lengthy time delay since the original plea. Defendant argues that he should be resentenced under the sentencing guidelines. We disagree. Defendant qualifies as an ordinary habitual felony offender (HO) under the 1988 statute. See § 775.084(1)(a), Fla. Stat. (Supp.1988). The plea agreement was for habitualization. As to count I, robbery without a weapon, the original sentencing intent can be approximated by striking the mandatory minimum sentence, and amending the judgment to reflect an adjudication as HO, not HVO. The same applies to count II, attempted robbery without a weapon, but in addition the sentence on that count exceeds the legal maximum, and the sentence must be reduced to the legal maximum. Defendant need not be present. The cause is remanded to the trial court for entry of amended judgments and sentences.
Petition granted.
NOTES
[1]  Although not pertinent here, the 1989 amendment to the HVO statute was held invalid because of a violation of the single subject rule, with the result that the effective date of the 1989 amendment was delayed to May 2, 1991. See State v. Johnson, 616 So.2d 1, 4 (Fla.1993); Shelton v. Singletary, 727 So.2d 310 (Fla. 3d DCA), review denied, 737 So.2d 551 (Fla.1999).
