
855 So.2d 664 (2003)
Michael A. NEDD, Appellant,
v.
STATE of Florida, Appellee.
No. 2D02-5457.
District Court of Appeal of Florida, Second District.
September 10, 2003.
Rehearing Denied October 2, 2003.
DAVIS, Judge.
Michael A. Nedd appeals the denial of his motion for postconviction relief filed *665 pursuant to Florida Rule of Criminal Procedure 3.800. Although we agree with Nedd that his sentence is illegal, we affirm the denial because this attack is not properly brought pursuant to rule 3.800.
Nedd was originally charged by information with trafficking in twenty-eight grams to thirty kilograms of heroin. He entered a negotiated plea to the reduced charge of trafficking in fourteen to twenty-eight grams, in return for a fifteen-year minimum mandatory sentence.[1] When Nedd entered his plea, section 893.135(1)(c)(1)(b), Florida Statutes (2001), required the fifteen-year minimum mandatory term for this offense.
Nedd's request for relief is based on this court's decision in Taylor v. State, 818 So.2d 544 (Fla. 2d DCA), review dismissed, 821 So.2d 302 (Fla.2002), which declared chapter 99-188, Laws of Florida, unconstitutional. The fifteen-year minimum mandatory requirement had been added by an amendment to section 893.135 contained in chapter 99-188. Thus, Nedd argues that his sentence was illegal since the amendment was not valid on the date he committed his offense, December 21, 2000.
The trial court denied Nedd's motion, finding that the legislature had subsequently reenacted the statutory provisions included in the amendments retroactive to the date of the original enactment. Citing Carlson v. State, 2002 WL 31202145, ___ So.2d ___ (Fla. 5th DCA 2002), the trial court concluded that Nedd's sentence was legal.
Although we agree with Nedd that his sentence is illegal based on Taylor and Green v. State, 839 So.2d 748 (Fla. 2d DCA 2003), the trial court's denial of the requested relief must be affirmed. Nedd's sentence is the product of a negotiated plea. Both the State and Nedd bargained for the agreement. While Nedd has sought relief under rule 3.800 to obtain correction only of his sentence, he is actually challenging the terms of a plea agreement and, thus, the resulting convictions. Because a plea withdrawal is a potential consequence in this case, Nedd must seek relief under rule 3.850. In that proceeding, the State will have the option to either agree to a resentencing or withdraw from the plea agreement and proceed to trial on the original charges. Bruno v. State, 837 So.2d 521 (Fla. 1st DCA 2003).
Accordingly, we affirm the trial court's denial of Nedd's motion without prejudice to his right to file an appropriate motion under rule 3.850.
Affirmed.
FULMER and CANADY, JJ., Concur.
NOTES
[1]  The negotiations also left open the possiblity that the sentence might be reduced if Nedd provided "substanital assistance" in another case. That relief was not granted and is not involved in this appeal.
