
562 So.2d 792 (1990)
Vermon T. DONALD, Appellant,
v.
STATE of Florida, Appellee.
No. 89-755.
District Court of Appeal of Florida, First District.
May 29, 1990.
Rehearing Denied July 10, 1990.
*793 Lorin J. Lee of Morton Law Center of Tallahassee, P.A., Tallahassee, for appellant.
Robert A. Butterworth, Atty. Gen., Bradley R. Bischoff, Asst. Atty. Gen., Tallahassee, for appellee.
SMITH, Judge.
Appellant appeals his sentences, contending they were imposed in violation of the double jeopardy prohibition against increasing the severity of a sentence once the defendant has begun serving a sentence previously imposed. We reverse.
While on probation for the offense of armed burglary, appellant committed the offense of attempted first degree murder with a firearm. The court determined that appellant was an habitual violent felony offender and that he became subject to a sentence pursuant to the newly amended section 775.084(4)(b)1., Florida Statutes (Supp. 1988). The statute provides that for a felony of the first degree, the habitual violent felony offender may be sentenced for life, and shall not be eligible for release for fifteen years. Appellant's sentencing guidelines scoresheet recommended a sentence of twenty years incarceration. Commenting that he did not think that a life sentence was appropriate under the facts of this case, the judge sentenced appellant as an habitual violent felony offender to twenty years, with a mandatory term of fifteen years without eligibility for parole. The court also revoked appellant's probation and sentenced him to a concurrent twenty year sentence for the armed burglary offense.
The next day, the trial judge recalled appellant and resentenced him. The judge explained that he had erroneously sentenced appellant to twenty years on the attempted first degree murder conviction, whereas the statute, section 775.084(4)(b)1., authorized the imposition of the fifteen year minimum mandatory sentence only in conjunction with a life sentence. The trial court then gave appellant concurrent sentences of thirty years for the armed burglary and attempted first degree murder convictions. The judgment and sentence for attempted first degree murder provides that appellant is being sentenced as an habitual violent felony offender and that he is subjected to a three year minimum mandatory for the use of a firearm. Accompanying the judgment and sentence is a Statement of Reasons for Upward Departure From Sentencing Guidelines which provides in pertinent part:
The defendant was before the Court for sentencing following a revocation of probation on a conviction of Armed Burglary, and following a jury verdict of guilty of Attempted First Degree Murder, and was sentenced to 30 years in the custody of the Department of Corrections, on each offense, concurrent. The *794 sentence imposed was an upward departure from the sentencing guidelines for the following reasons:
1. The character of the violation of probation, to-wit: Attempted First Degree Murder, and the length of time he had been on probation (approximately thirteen months), after serving a prison sentence for Armed Burglary of a Structure, justifies a sentence beyond a two-cell departure from the guideline sentence for Armed Burglary. State v. Pentaude, 500 So.2d 526 (Fla. 1987).
2. The guideline sentence of 17-22 years for Attempted First Degree Murder is not applicable because of this court's finding and adjudication that the defendant is an habitual violent felony offender. Section 775.084(4)(e), Florida Statutes (1988).
As a general rule, once a person has begun serving a lawfully imposed sentence, he may not thereafter be resentenced for an increased term of incarceration.[1] However, if an illegal sentence has been imposed, there is no constitutional impediment to sentencing a defendant to a greater sentence upon resentencing, as long as judicial vindictiveness plays no part in the resentencing. In the latter circumstance, it is said that the unlawful sentence is of no legal effect, allowing the court to correct the sentence by imposing the lawful term at any time the illegality is discovered, regardless of whether the correction involves an increase. Brown v. State, 521 So.2d 110 (Fla. 1988); Fasenmyer v. State, 457 So.2d 1361 (Fla. 1984); Beech v. State, 436 So.2d 82 (Fla. 1983); Troupe v. Rowe, 283 So.2d 857 (Fla. 1973); Daniels v. State, 513 So.2d 244 (Fla. 2d DCA 1987); Padgett v. State, 497 So.2d 724 (Fla. 1st DCA 1986); Andrews v. State, 357 So.2d 489 (Fla. 1st DCA 1978); and Flowers v. State, 351 So.2d 387 (Fla. 1st DCA 1977); see also, Annot., 28 ALR4 147 (1984); Annot., 26 ALR4 905 (1983).
The primary issue raised by appellant is whether a sentence for a felony of the first degree under the habitual violent felony offender statute must be for life, in order to invoke the fifteen year mandatory provision, or whether a life sentence is permissive rather than mandatory. Appellant argues that under section 775.084(4)(b)1., it is not unlawful to impose a twenty year sentence with a minimum mandatory term of fifteen years. The statute provides that a court "may" sentence the habitual violent felony offender for life; it does not provide that the court "shall" sentence him for life. Thus, argues appellant, the trial court was not permitted to resentence appellant to the greater punishment of thirty years, since its first sentence was a legal one.
Section 775.084(4)(a)1., governing the sentencing of habitual felony offenders, provides:
(4)(a) The court, in conformity with the procedure established in subsection (3), shall sentence the habitual felony offender as follows:
1. In the case of a felony of the first degree, for life.
Section 774.084(4)(b)1., governing the sentencing of habitual violent felony offenders, provides as follows:
(b) The court, in conformity with the procedure established in subsection (3), may sentence the habitual violent felony offender as follows:
1. In the case of a felony of the first degree, for life, and such offender shall not be eligible for release for 15 years.
While it is generally true that the word "may" should be given a permissive meaning, it is sometimes construed as meaning "shall." See 49 Fla.Jur.2d, Statutes, § 18 (1984). When a question arises as to the meaning to be given to the use of the words "shall" or "may" in a statute, we are required to examine the context in which the word was used and the legislative intent. S.R. v. State, 346 So.2d 1018, 1019 (Fla. 1977). "May" has been deemed to be obligatory where a statute directs the doing of a thing for the sake of justice, Allied Fidelity Insurance Co. v. State, 415 So.2d 109, 111 (Fla. 3d DCA 1982), or where a statute says a thing "may" be done by a public official for the public *795 benefit. Seaboard Airline Railway Co. v. Wells, 100 Fla. 1027, 130 So. 587, 593 (1930).
Examining section 775.084 in its entirety, we observe, initially, that the statute permits the court some discretion in determining whether a defendant is an habitual felony offender or habitual violent felony offender. It is also clear that the court has the option, under section 775.084(4)(c), Florida Statutes (Supp. 1988), of deciding that sentencing under the statute is not necessary for the protection of the public. Once the court decides, however, to sentence a defendant as an habitual felony offender or habitual violent felony offender, then the court is required to impose sentence in conformity with sections 775.084(4)(a) or 775.084(4)(b). It follows that in order to invoke the fifteen year mandatory provision of section 775.084(4)(b)1., the court was required to impose a life sentence. Here, the trial court attempted to combine the fifteen year mandatory provision with a sentence of only twenty years, which was an illegal sentence, and thus under the authorities already cited, the trial court was not precluded from resentencing appellant to a greater punishment the next day.
However, our inquiry does not end here, since we find that the trial court's subsequent thirty year sentence was an impermissible guidelines sentence. As stated earlier, although the trial court has some discretion in determining a defendant's habitual violent felony offender status, once the trial court determines to sentence an offender as an habitual violent felon, then the court is required to impose sentence in conformity with section 775.084(4)(b). While it is true that a sentence imposed under section 775.084 is not subject to the sentencing guidelines, section § 775.084(4)(e), it is our view that only a sentence imposed in accordance with section 775.084(4)(a) or (b) is exempt from the guidelines. The court may not, as it did in this case, adjudicate an offender to be an habitual violent felon and in the case of a felony of the first degree, sentence the felon to a term of years rather than to a life sentence with a minimum mandatory of fifteen years, required by section 775.084(4)(b)1. The felon must be sentenced under section 775.084 or pursuant to the sentencing guidelines, but the trial court may not, as it did here, sentence the felon to a departure guidelines sentence without written reasons on the grounds that the defendant is an habitual violent felony offender.
Because the trial court has already expressed the view that a life sentence is not appropriate in this case, we conclude that appellant may not be sentenced in accordance with section 775.084, and the trial court must impose a sentence in accordance with the provisions of the sentencing guidelines. Upon remand, should the trial court again impose a thirty year sentence, such sentence must be accompanied by a valid written reason for departure. See Jones v. State, 559 So.2d 204 (Fla. 1990).
With respect to the sentence for armed burglary, because the twenty year sentence initially imposed was clearly a lawful sentence, the trial court was precluded from thereafter resentencing appellant to the greater sentence of thirty years.
REVERSED and REMANDED for proceedings consistent with this opinion.
WENTWORTH and JOANOS, JJ., concur.
NOTES
[1]  Though there are exceptions to the rule, none are applicable here.
