(1) Whoever, without being authorized, licensed, or invited, willfully enters or remains in any structure or conveyance, or, having been authorized, licensed, or invited, is warned by the owner or lessee of the premises, or by a person authorized by the owner or lessee, to depart and refuses to do so, commits the offense of trespass in a structure or conveyance.
(2)(a) Except as otherwise provided in this subsection, trespass in a structure or conveyance is a misdemeanor of the second degree, punishable as provided in s. 775.082 or s. 775.083.
(b) If there is a human being in the structure or conveyance at the time the offender trespassed, attempted to trespass, or was in the structure or conveyance, the trespass in a structure or conveyance is a misdemeanor of the first degree, punishable as provided in s. 775.082 or s. 775.083.
(c) If the offender is armed with a firearm or other dangerous weapon, or arms himself or herself with such while in the structure or conveyance, the trespass in a structure or conveyance is a felony of the third degree, punishable as provided in s. 775.082, s. 775.083, or s. 775.084. Any owner or person authorized by the owner may, for prosecution purposes, take into custody and detain, in a reasonable manner, for a reasonable length of time, any person when he or she reasonably believes that a violation of this paragraph has been or is being committed, and he or she reasonably believes that the person to be taken into custody and detained has committed or is committing such violation. In the event a person is taken into custody, a law enforcement officer shall be called as soon as is practicable after the person has been taken into custody. The taking into custody and detention by such person, if done in compliance with the requirements of this paragraph, shall not render such person criminally or civilly liable for false arrest, false imprisonment, or unlawful detention.
(3) As used in this section, the term “person authorized” means any owner or lessee, or his or her agent, or any law enforcement officer whose department has received written authorization from the owner or lessee, or his or her agent, to communicate an order to depart the property in the case of a threat to public safety or welfare.