The appellant, Vernon Lee Peters, challenges the trial court’s judgments and sentences for two counts of second degree murder with a deadly weapon. We affirm the convictions, however, we reverse the sentences because they exceed the statutory maximum.
Pursuant to a plea agreement, the appellant pled guilty to two reduced charges of second degree murder with a deadly weapon, in violation of section 782.04, Florida Statutes (1985). The appellant was subsequently adjudicated guilty and sentenced according to the terms of the plea agreement to two concurrent terms of fifty years in prison. This timely appeal followed.
We agree with the appellant’s contention that the sentences imposed were illegal. Second degree murder with a deadly weapon is a life felony. §§ 775.087(l)(a), 782.04(2), Fla.Stat. (1985). A life felony committed af*1176ter October 1, 1983, is punishable by life imprisonment or by a term of imprisonment not to exceed forty years. § 775.082(3)(a), Fla.Stat. (1985). Therefore, whenever a court sentencing a life felony opts for a term of years in lieu of a life sentence, that court is limited to a sentence no harsher than forty years. Greenhalgh v. State, 582 So.2d 107 (Fla. 2d DCA 1991).
In the instant ease, since the concurrent fifty year prison terms imposed by the trial court exceed the statutory forty year maximum, the sentences are illegal. On remand, the state should be given the option of proceeding to trial on the original charges or agreeing to a sentence, with the trial court’s concurrence, within the forty year statutory maximum. Cayson v. State, 638 So.2d 1061 (Fla. 4th DCA 1994). See also Clemons v. State, 629 So.2d 1067 (Fla. 2d DCA), rev. denied, 639 So.2d 976 (Fla.1994).
Affirmed in part, reversed in part, and remanded with instructions.
SCHOONOVER, A.C.J., and PATTERSON and LAZZARA, JJ., concur.