
    Farris WILSON, Appellant, v. STATE of Florida, Appellee.
    No. 95-0941.
    District Court of Appeal of Florida, Fourth District.
    February 28, 1996.
    Farris Wilson, Indiantown, pro se appellant.
    Robert A. Butterworth, Attorney General, Tallahassee, and John Tiedemann, Assistant Attorney General, West Palm Beach, for ap-pellee.
   POLEN, Judge.

We grant appellee state’s Motion for Rehearing En Banc, recognizing that our September 13, 1995, slip opinion is in conflict with our earlier decision in Cayson v. State, 638 So.2d 1061 (Fla. 4th DCA 1994). We withdraw the previously issued opinion, and substitute the following:

We reverse the trial court’s order denying appellant’s second motion to correct illegal sentence pursuant to Florida Rule of Criminal Procedure 3.800(a). This is so even though appellant filed a previous, unsuccessful 3.800(a) motion, and despite appellant having agreed to a sentence of 55 years in prison (including a 3-year minimum mandatory) for the offense of second degree murder with a firearm. The sentence was an illegal one, as the offense to which appellant pled is punishable by a term of years not to exceed 40 years, or life in prison.

Under rule 3.800(a), a motion to correct an illegal sentence can be brought at any time, and even when imposed pursuant to a plea bargain, such a sentence must be vacated upon proper motion. Cayson v. State, 638 So.2d 1061 (Fla. 4th DCA 1994). As in Cayson we hold that on remand, the state should have the option of having the trial court impose a sentence not to exceed 40 years in prison, or vacate the plea and proceed to trial. The state and defendant sought to enter a bargain, but the proposed sentence was an illegal one. The defendant is entitled to be relieved of this illegal sentence, but the state should not then be held to the bargain, unless it accedes to the lesser sentence, or a new [legal] plea bargain can be reached.

GUNTHER, C.J., GLICKSTEIN, DELL, STONE, WARNER, FARMER, KLEIN, PARIENTE, STEVENSON, SHAHOOD and GROSS, JJ., concur.  