
990 So.2d 686 (2008)
J.L.H., Appellant,
v.
STATE of Florida, Appellee.
No. 2D08-543.
District Court of Appeal of Florida, Second District.
September 19, 2008.
James Marion Moorman, Public Defender, and Maureen E. Surber, Assistant Public Defender, Bartow, for Appellant.
Bill McCollum, Attorney General, Tallahassee, and Jonathan P. Hurley, Assistant Attorney General, Tampa, for Appellee.
WHATLEY, Judge.
J.L.H. appeals his adjudication of delinquency for resisting an officer without violence. He argues that the trial court erred in denying his motion to dismiss. See Fla. R. Juv. P. 8.110(k) (providing for motion for judgment of dismissal to test legal sufficiency of evidence in juvenile proceedings). We reverse.
On November 7, 2007, Officer Ouellette received a call to investigate a burglary to a vehicle at a motel in Lake Wales. The call stated that a next door neighbor was trying to steal the complainant's Xbox out of his car. When Officer Ouellette arrived, he saw J.L.H. run quickly inside an apartment upon seeing the officers. Officer Ouellette investigated the burglary and determined that there had not been a burglary to the vehicle. He then asked the complainant who J.L.H. was, and the complainant, who was related to J.L.H., gave the officer an incorrect name for J.L.H. J.L.H. gave the officer an incorrect date of birth, so it took some time, but Officer *687 Ouellette was finally able to determine J.L.H.'s true name. When he showed J.L.H. the computer screen with his true identity revealed, J.L.H. ran. Officer Ouellette and a fellow officer quickly apprehended J.L.H. and arrested him for giving false information and resisting without violence.
After Officer Ouellette testified to the foregoing at trial, defense counsel moved for a judgment of dismissal of both counts. Counsel argued that in order to be convicted of giving a false name, one must be under arrest or lawful detention and Officer Ouellette had given no testimony showing that J.L.H. was under either type of restraint. See § 901.36, Fla. Stat. (2007). The State responded by nol prossing that count. Defense counsel also argued that since there was no basis for an arrest for giving a false name, there was no basis for an arrest for resisting arrest without violence because one may resist an unlawful arrest without violence. The trial court denied the defense motion, ruling that Officer Ouellette had every right to detain J.L.H. because he was investigating a burglary. In this appeal, the State argues that a reasonable inference can be made that Officer Ouellette was still engaged in the execution of a lawful duty when J.L.H. fled. The State asserts that this inference can be made from the fact that Officer Ouellette never testified that his burglary investigation had concluded prior to his inquiry into J.L.H.'s identity.
A ruling on a motion for judgment of dismissal is subject to de novo review. E.A.B. v. State, 964 So.2d 877, 878 (Fla. 2d DCA 2007). Although the evidence must be viewed in a light most favorable to the State, "dismissal is warranted when the State's evidence was not sufficient to permit a rational trier of fact to find that the elements of the crime were proved beyond a reasonable doubt." Id. at 878. In the present case, Officer Ouellette testified in pertinent part as follows: "I investigated the burglary, but there was no burglary to the vehicle. After that, I asked the complainant ... who he [J.L.H.] was." (Emphasis added.) We believe this testimony clearly indicates that Officer Ouellette investigated J.L.H.'s identity only after he determined that no burglary had occurred. More significantly, Officer Ouellette provided no testimony to indicate that he had a reasonable suspicion that J.L.H. was committing, had committed, or was about to commit a crime. Thus, he had no legal basis for detaining J.L.H. See id.
"[A]n individual is guilty of resisting or obstructing an officer by flight only if he flees while knowing of the officer's intent to detain him and if the officer is justified in detaining the individual before he flees." J.D.H. v. State, 967 So.2d 1128, 1130 (Fla. 2d DCA 2007) (citing Yarusso v. State, 942 So.2d 939, 943 (Fla. 2d DCA 2006)). Accord E.A.B., 964 So.2d 877. While J.L.H. knew that Officer Ouellette wanted to detain him, Officer Ouellette had no legal basis to detain him. Thus, Officer Ouellette was not lawfully executing a legal duty when J.L.H. ran from him, and therefore, J.L.H. could not be guilty of resisting. See id. at 880. Accordingly, we reverse and remand for discharge.
DAVIS and VILLANTI, JJ., Concur.
