Derrick Sims challenges the denial of two motions to suppress evidence. Because the record supports a finding that Sims was lawfully detained and then consented to the search of his vehicle, we affirm.
The Bay County Sheriffs Office obtained a search warrant to search an apartment of an individual suspected of selling narcotics. As the police were preparing to commence their search, Sims was seen driving to the subject apartment, entering, and then after a short while, leaving the apartment. As he left, he was stopped by police. The officer who directed the stop of Sims testified at the subsequent suppression hearing that he did not know, at the time Sims was stopped, whether Sims was a resident of the apartment. After stopping Sims, the officer asked for permission to search his car. According to the unrebutted testimony adduced at the suppression hearing, Sims gave consent, and cocaine and digital scales with cocaine residue were discovered in the search of the car. Sims pled guilty to possession of cocaine and paraphernalia specifically reserving the right to appeal the denial of his motions for suppression.
By his first motion, Sims argued that the police lacked reasonable suspicion to stop him. By his second motion, Sims sought suppression on the ground that, in a separate criminal proceeding, the search warrant was found to be lacking in probable cause and the evidence obtained as a result of the search of the apartment was suppressed. Sims argues that, because the warrant was found to be lacking in probable cause, the search of Sims must be examined as though no warrant was issued in the case. As noted, the trial court rejected both arguments.
As a threshold matter, the state argues that under section 924.051(4), Florida Statutes (1999)1 and rule 9.140(b)(2)(A), Florida Rules of Appellate Procedure, Sims failed to preserve the suppression issues. This argument is without merit because the record reflects that the issues were clearly preserved. At the plea hearing, appellant’s counsel stated: “... we would also like to enter this plea while reserving our right to appeal the decisions on both of the motions to suppress that were filed before this court as they were dispositive of this case.” At the conclusion of the hearing, the trial court advised appellant that he had “the right to appeal the issue of the suppression hearing” and, if that appeal was successful, “that takes away everything we have done here today.”
In reviewing an order on a motion to suppress, the reviewing court is to consider the evidence presented at the suppression hearing in a light most favorable to sustaining the trial court’s ruling. See San Martin v. State, 705 So.2d 1337 (Fla.1997), cert. denied, San Martin v. Florida, 525 U.S. 841, 119 S.Ct. 105, 142 L.Ed.2d 84 (1998); State v. Butler, 655 So.2d 1123 (Fla.1995). Further, while the reviewing court is required to accept the trial court’s determination of the “historical facts” surrounding the challenged seizure and/or search, it reviews de novo the application of law to the historical facts. State v. Moore, 791 So.2d 1246 (Fla. 1st DCA 2001), citing Ornelas v. U.S., 517 U.S. 690, 116 S.Ct. 1657, 134 L.Ed.2d 911 *46(1996), and Porter v. State, 765 So.2d 76 (Fla. 4th DCA 2000); see also Hines v. State, 737 So.2d 1182 (Fla. 1st DCA 1999).
Police may detain a person when his premises are being searched. Michigan v. Summers, 452 U.S. 692, 704, 101 S.Ct. 2587, 2596, 69 L.Ed.2d 340 (1981). Police may also detain a person observed on the premises being searched pursuant to a warrant in order to secure the premises being searched or to determine the reason for the presence of those persons on the premises. Belvin v. State, 585 So.2d 1103, 1105 (Fla. 2d DCA 1991). As the reviewing court explained in State v. Thomas, 603 So.2d 1382, 1384 (Fla. 5th DCA 1992), it is “logically and legally irrelevant” whether a person detained during the execution of a search warrant
is detained while on the premises, while exiting the premises, or while in the process of entering the premises as the officers are executing the warrant. It would defy the court’s logic in Michigan v. Summers to say that an individual who may be properly detained during the execution of a search warrant could escape detention either if, seeing the officers approach, the person manages to make it off the premises before the officers could stop him, or, if, as the person is in the process of entering the premises, he sees the officers approach and turns around and walks away from the premises.
See also United States v. Cochran, 939 F.2d 337, 339 (6th Cir.1991) (“Summers does not impose upon police a duty based on geographic proximity (i.e., defendant must be detained while still on his premises); rather, the focus is upon police performance, that is, whether the police detained defendant as soon as practicable after departing from his residence.”). The stop here was permissible, and police were enti-tied to ask for permission to search Sims’ vehicle. See State v. Holland, 680 So.2d 1041 (Fla. 1st DCA 1996), aff'd, 696 So.2d 757 (Fla.1997); Gomez v. State, 748 So.2d 352 (Fla. 3d DCA 1999), rev. dismissed, 762 So.2d 916 (Fla.2000).
Sims offers no authority for reversing the denial of his second motion to suppress. As noted, Sims was not searched pursuant to a search warrant. Instead, he was validly stopped during the execution of a warrant, see Michigan v. Summers and State v. Thomas, and thereafter gave consent to a search. Thus, it is of no moment that in a separate criminal proceeding the warrant subsequently was deemed lacking in probable cause. Compare U.S. v. Leon, 468 U.S. 897, 104 S.Ct. 3405, 82 L.Ed.2d 677 (1984)(evidence seized under an invalid warrant may be admissible if the police officer acted in objectively reasonable reliance on the warrant).2
AFFIRMED.
MINER and PADOVANO, JJ., concur.. Section 924.051(4), Florida Statutes (1999) states in relevant part:
If a defendant pleads nolo contendere without expressly reserving the right to appeal a legally dispositive issue, or if a defendant pleads guilty without expressly reserving the right to appeal a legally dispositive issue, the defendant may not appeal the judgment or sentence.
. Sims has not argued that the affidavit was so lacking in indicia of probable cause that reliance on the warrant was unreasonable. Leon, 468 U.S. at 923, 104 S.Ct. at 3421.