
18 So.3d 1259 (2009)
W.J., a juvenile, Appellant,
v.
The STATE of Florida, Appellee.
No. 3D08-3110.
District Court of Appeal of Florida, Third District.
October 14, 2009.
*1260 Carlos J. Martinez, Public Defender, and Valerie Jonas and Melissa del Valle, Assistant Public Defenders, for appellant.
Bill McCollum, Attorney General, and Timothy R.M. Thomas, Assistant Attorney General, for appellee.
Before COPE and GERSTEN, JJ., and SCHWARTZ, Senior Judge.
COPE, J.
This is an appeal of an order determining that W.J. committed the offense of resisting an officer without violence. We affirm.
The arresting officer in this case had previously encountered W.J. in the playground of a Liberty City public housing project. The officer warned W.J. to leave the property and warned him that he would arrest him for trespass if he returned.
Two days later that officer, with other officers, drove to the playground. They observed a group shooting dice and placing bets. W.J. was in the group but the officer did not observe him actually gambling.
When the officers emerged from their unmarked vehicles and identified themselves as police officers, W.J. and another boy ran away. The officer caught W.J. W.J. was charged with resisting an officer without violence and with trespass. The court found that W.J. committed the offense of resisting an officer without violence, withheld adjudication, and placed W.J. on probation. W.J. has appealed.
W.J. argues that there was neither reasonable suspicion for an investigatory stop, nor probable cause. He contends that in the absence of a reasonable suspicion or probable cause, the officer was not engaged in the lawful execution of a legal duty under section 843.02, Florida Statutes (2008), and that the charge must be dismissed. We conclude that there was probable cause.
The officer had previously ordered W.J. to leave the housing project and warned that he would be arrested for trespass if he returned. W.J. returned. There was probable cause to arrest him for trespass. See § 810.09, Fla. Stat. (2008).
At trial, W.J. successfully obtained a judgment of dismissal on the trespass charge, because the State did not establish that the officer had the authority to warn W.J. to stay off the property. However, the fact that the State did not prevail at trial on the trespass charge does not defeat the fact that probable cause for the arrest existed. See E.W. v. State, 873 So.2d 485, 488 (Fla. 1st DCA 2004). The officer was engaged in the lawful execution of a legal duty. As this ground is dispositive, *1261 we need not reach the parties' other arguments on the issue.
Affirmed.
