
672 So.2d 639 (1996)
Carvie William FARMER, Appellant,
v.
STATE of Florida, Appellee.
No. 95-1687.
District Court of Appeal of Florida, Fifth District.
April 26, 1996.
*640 Jeffery M. Pfister of Jeffery M. Pfister, P.A., Tavares, for Appellant.
Robert A. Butterworth, Attorney General, Tallahassee, and Anthony J. Golden, Assistant Attorney General, Daytona Beach, for Appellee.
COBB, Judge.
In 1989, Farmer pled to second degree murder and received a sentence of 90 years that included a three year minimum mandatory (life felony) for use of a firearm. The factual basis for the plea, as presented by the prosecutor, indicated that on November 4, 1988, Farmer took a shotgun and killed one Alzo Elkins in Sumter County. The scoresheet that was prepared by the state attorney's office showed the degree of felony as "life." This reclassification from a felony of the first degree to a life felony was mandated by section 775.087(1)(a), Florida Statutes (1987). The statutory maximum penalty for a life felony was a term of life or term of imprisonment not to exceed 40 yearswhich rendered the 90-year sentence invalid.
Farmer then filed a petition for a writ of habeas corpus with this court. In Farmer v. State, 642 So.2d 127 (Fla. 5th DCA 1994), the petition was granted and the case remanded to the lower court to consider whether the sentence was illegal:
It appears to this court that the appellant did not receive effective assistance of counsel in appealing the denial of his post-conviction relief motion, in that no argument regarding his illegal sentence was raised. Therefore, the petition for writ of habeas corpus is granted and this cause is remanded to the trial court for consideration of petitioner's argument that his sentence is illegal. Should the trial court determine the sentence is illegal then a new sentence should be imposed. If not, then an order so determining, with findings of fact and law, should be entered.
In a concurring opinion, Judge Griffin noted that Farmer was not automatically entitled to a reduction to 40 years since the state would have the option to withdraw the plea agreement and try the defendant for first degree murder. She cited to Hayes v. State, 598 So.2d 135 (Fla. 5th DCA 1992) and Jolly v. State, 392 So.2d 54 (Fla. 5th DCA 1981).
On remand, the lower court received memorandums of law and ruled that the state attorney incorrectly filled in the scoresheet to show a life felony. The court corrected the scoresheet to show a first degree felony and dropped the three year minimum mandatory (which Farmer already had served). Unfortunately, this did not solve the problem and the sentence is still invalid. This is so because the bargain was for a life felony since a firearm was used in the commission of the felony. We note that in this case a life sentence is not an option for the lower court since it would be an increase of the sentence Farmer bargained for (90 years) and thus illegal. Salas v. State, 589 So.2d 343 (Fla. 4th DCA 1991).
We reverse and remand with instructions to the lower court to allow the state to withdraw from the plea and go to trial, or, in the alternative, accept the previous sentencing provisions with the 90 year term of incarceration changed to 40 years. See Dyer v. State, 629 So.2d 285 (Fla. 5th DCA 1993).
REVERSED AND REMANDED.
PETERSON, C.J., and THOMPSON, J., concur.
