
    Richard ELBERT, Appellant, v. STATE of Florida, Appellee.
    No. 97-02520.
    District Court of Appeal of Florida, Second District.
    Jan. 21, 1998.
   PER CURIAM.

Richard Elbert appeals the order summarily denying his motion for postconviction relief filed pursuant to Florida Rule of Criminal Procedure 3.850. Although Elbert raised numerous grounds for relief, the only meritorious issue concerns the trial court’s failure to give Elbert the opportunity to withdraw his plea because the addition of the three-year minimum mandatory provision changed the sentence so that it was not in accordance with his plea agreement.

On March 29, 1995, Elbert entered into a written plea agreement for a specific sentence of twenty-five years in prison as a habitual felony offender with an adjudication of guilt to four burglaries, one of which was an armed burglary. The transcript of the plea colloquy on March 29 does not include any mention of a firearm or any minimum mandatory sentence. At the April 4 sentencing hearing the trial court imposed the agreed-upon sentence of twenty-five years in prison with credit for time served. The transcript of the April 4 hearing contains no mention of a firearm or a minimum mandatory provision.

At a hearing the next day, the State asserted that the armed burglary involved a firearm, which would require the court to impose a three-year minimum mandatory sentence pursuant to section 775.087(2), Florida Statutes (1993), but the prosecutor neglected to include that information on the guidelines scoresheet. The State requested that the court amend the judgment and sentence accordingly. Elbert did not personally appear at the April 5 hearing, but his attorney represented that he had explained the law to Elbert, that Elbert was “not happy about it,” and would like the court not to impose the three-year minimum.

The trial court stated that it had no choice and then amended the judgment and sentence to include the minimum mandatory provision. The factual basis described at the plea hearing indicates that Elbert stole a .357 pistol and bullets from a residence and that the firearm was recovered in the front yard where Elbert was arrested. Section 775.087(2) clearly applies under these circumstances. See Williams v. State, 517 So.2d 681 (Fla.1988).

While the trial court is correct that the imposition of the three-year minimum mandatory sentence for armed burglary involving a firearm is not discretionary, the record shows that Elbert entered his plea in reliance on the trial court’s offer of a twenty-five-year habitual offender sentence; therefore, Elbert must be given an opportunity to withdraw his plea. See State v. Ferguson, 691 So.2d 578 (Fla. 2d DCA 1997). Accordingly, we reverse and remand for the trial court to allow Elbert to withdraw his plea. The trial court’s order is affirmed as to all other claims raised in the motion. .

Affirmed in part, reversed in part, and remanded.

PARKER, C.J., and BLUE and QUINCE, JJ., concur.  