
443 So.2d 366 (1983)
STATE of Florida, Appellant,
v.
Alan Bruce PILCHER, Appellee.
No. 82-1270.
District Court of Appeal of Florida, Fifth District.
December 29, 1983.
*367 Jim Smith, Atty. Gen., Tallahassee, and Evelyn D. Golden, Asst. Atty. Gen., Daytona Beach, for appellant.
James B. Gibson, Public Defender, and Theresa K. Edwards, Asst. Public Defender, Daytona Beach, for appellee.
DAUKSCH, Judge.
This is a proper appeal by the state from an alleged illegal sentence. Rule 9.140(c)(1)(I). The state says the sentence is illegal because the judge refused to require appellee to serve a minimum of three years. See, § 775.087, Fla. Stat. (1981). The allegations and proof against appellee regard a burglary where he stole a firearm along with other items.
This case is novel and is not governed by Mills v. State, 400 So.2d 516 (Fla. 5th DCA 1981). In Mills the question was whether one is guilty of armed burglary if he unlawfully enters a structure and steals a gun and its projectiles. We said yes because the statute provides that it is a higher form of burglary if one "[i]s armed, or arms himself within such structure." See, § 810.02(2)(b), Fla. Stat. (1981). The statute is specific in its wording  if one arms himself after committing a burglary but while "within such structure" then he is guilty of the armed burglary as opposed to the lesser burglary.
Here the statute is different. Section 775.087(2) provides in pertinent part:
"Any person who is convicted of: ... burglary . .. and who had in his possession a `firearm,' ... shall be sentenced to a minimum ... of 3 calendar years."
(emphasis added).
In order to fall within the mandatory minimum statute the defendant must have had the gun in his possession when he committed the burglary. A burglary is committed and is complete when the entering upon the premises occurs. If a person enters, or remains in, a structure with the intent to commit an offense then the crime has occurred. See, § 810.02(1), Fla. Stat. (1981); Estevez v. State, 313 So.2d 692 (Fla. 1975) (see especially Adkins, C.J., concurring at 695).
The trial court was correct in not imposing the mandatory minimum sentence.
AFFIRMED.
COBB and SHARP, JJ., concur.
