
782 So.2d 971 (2001)
STATE of Florida, Appellant,
v.
Robert Earl KINDLE, Appellee.
No. 5D00-2020.
District Court of Appeal of Florida, Fifth District.
April 12, 2001.
*972 Robert A. Butterworth, Attorney General, Tallahassee, and Pamela J. Koller, Assistant Attorney General, Daytona Beach, for Appellant.
James B. Gibson, Public Defender, and Lyle Hitchens, Assistant Public Defender, Daytona Beach, for Appellee.
SAWAYA, J.
The State appeals the order of the trial court granting Robert E. Kindle's (Kindle) motion to suppress evidence. The State contends that the trial court erred when it ruled that the police did not have authority to request consent to search Kindle's vehicle after the conclusion of a traffic stop. We agree and reverse.
Officer Billy Rhodes (Rhodes) of the West Melbourne Police Department effected a traffic stop after observing Kindle's vehicle pulling a trailer which had no taillights or license plate. After issuing a citation, Rhodes asked Kindle, who was standing outside the vehicle, for permission to search the vehicle. Kindle consented to the search and thereafter Rhodes directed Sergeant Mark Thompson (Thompson), who had arrived for "officer protection," to conduct the search. Thompson discovered a prescription bottle that contained twenty white pills in the vehicle. The Physician's Desk Reference indicated that the pills were hydrocodone. Kindle was arrested and charged with one count of possession of a controlled substance in violation of section 893.13(6)(a), Florida Statutes (1999).
Kindle filed a motion to suppress in which he alleged that the detention and arrest were illegal and that he did not validly consent to the search. At the suppression hearing, Rhodes described the events which led to Kindle's eventual arrest *973 Moreover, he testified that the search of Kindle's vehicle resulted from Kindle's voluntary, expressed consent.[1]
After hearing testimony and argument on the motion, the trial court concluded: 1) the original stop was legal and the original detention for the purposes of issuing a citation for having no tag or taillights on the trailer was wholly justified; 2) after issuance of the citation, consent was requested of Kindle to search his vehicle and he freely gave his consent; 3) the time for the overall stop, including the search of the vehicle, was reasonable under the circumstances; and 4) there was no evidence or suspicion of criminal activity.
Relying on Gilchrist v. State, 757 So.2d 582 (Fla. 1st DCA 2000), the trial court granted the motion to suppress finding that the consent to search was invalid because the traffic stop lasted longer than the time necessary to write the traffic citation and the officer did not have reasonable suspicion based on articulable facts that criminal activity was afoot to justify a detention of Kindle beyond that period.
A trial court's ruling on a motion to suppress often involves mixed questions of fact and law. Lester v. State, 754 So.2d 746 (Fla. 1st DCA 2000); Hines v. State, 737 So.2d 1182 (Fla. 1st DCA 1999). The standard of review we must apply to the findings of fact is whether competent, substantial evidence supports the findings. See Hines. We must construe all the evidence, and reasonable inferences therefrom, in a manner most favorable to sustaining the trial court's ruling. See San Martin v. State, 717 So.2d 462, 469 (Fla. 1998), cert. denied, 526 U.S. 1071, 119 S.Ct. 1468, 143 L.Ed.2d 553 (1999). The trial court's application of the law to the facts is reviewed de novo. Hines. The issue in this case is whether the stop was legal and whether Kindle consented to the search. We undertake to resolve this issue pursuant to these standards.
The courts generally agree that during a valid traffic stop, a law enforcement officer may ask the driver of the vehicle for consent to search, and if it is freely and voluntarily given, illegal narcotics seized incident to that search will generally be shielded from suppression. See Gomez v. State, 748 So.2d 352 (Fla. 3d DCA 1999), rev. dismissed, 762 So.2d 916 (Fla.2000); State v. Parrish, 731 So.2d 101 (Fla. 2d DCA 1999); State v. Holland, 680 So.2d 1041 (Fla. 1st DCA 1996); State v. Cromatie, 668 So.2d 1075 (Fla. 2d DCA 1996); see also Castro v. State, 755 So.2d 657 (Fla. 4th DCA 1999). But if the stop is illegal, consent to search thereafter given is generally considered invalid. See, e.g., Crooks v. State, 710 So.2d 1041 (Fla. 2d DCA 1998); Jordan v. State, 707 So.2d 338 (Fla. 2d DCA 1998), rev. dismissed, 717 So.2d 538 (Fla.1998). Thus we must first determine whether the stop was valid.
An officer's stop of an automobile is legal when the officer has probable cause to believe that a traffic violation has occurred. Whren v. United States, 517 U.S. 806, 116 S.Ct. 1769, 135 L.Ed.2d 89 (1996); Gomez, 748 So.2d at 352 ("Regardless of the individual officer's motivation, the traffic stop was lawful because the officer had probable cause to believe that the defendant had violated the traffic code by driving a vehicle with an expired temporary tag."); Scott v. State, 710 So.2d 1378 (Fla. 5th DCA 1998). Here Rhodes *974 testified without dispute that the trailer's taillights were inoperative and that the trailer did not have a license plate. Section 316.610, Florida Statutes (1999) provides that it is a violation to drive a vehicle, or for the owner to allow his vehicle to be driven, in an unsafe condition or without the required equipment. Thus, given the inoperative taillights and missing tag, the initial stop of Kindle's vehicle was clearly lawful. See Welch v. State, 741 So.2d 1268 (Fla. 5th DCA 1999); see also Saviory v. State, 717 So.2d 200 (Fla. 5th DCA 1998) (concluding that officers had reasonable basis for a stop of vehicle where license tag was not readable as required by law), rev. denied, 729 So.2d 394 (Fla.1999); State v. Snead, 707 So.2d 769 (Fla. 2d DCA 1998) (finding that officer had probable cause to make a traffic stop where he observed that a taillight and a brake light on the driver's side were inoperable).
Florida courts have consistently held that a traffic stop must last no longer than the time it takes to write the traffic citation. See, e.g., Thomas v. State, 614 So.2d 468 (Fla.1993); Cresswell v. State, 564 So.2d 480 (Fla.1990); Welch. The detention may continue past that time if the law enforcement officer has a reasonable suspicion based on articulable facts that criminal activity was committed or was about to be committed. Dukes v. State, 753 So.2d 780 (Fla. 5th DCA 2000); State v. Sanders, 712 So.2d 851 (Fla. 5th DCA 1998); see also McNeil v. State, 656 So.2d 1320 (Fla. 5th DCA 1995). The State did not establish by substantial competent evidence that the officer had such a suspicion when he stopped Kindle. However, the detention may also continue if the driver has freely and voluntarily given consent to a search of himself or the vehicle. Cromatie, 668 So.2d at 1077 ("[W]e conclude that the officer conducting the traffic stop could request permission to search the car and detain all occupants of the car until he completed the search in the car."). The State contends that Kindle freely and voluntarily consented to the search of his vehicle which justified his continued detention.
When the validity of a search depends on consent, the State has the burden of proving that the necessary consent was obtained and that it was freely and voluntarily given. Dormezil v. State, 754 So.2d 168, 169 (Fla. 5th DCA 2000) ("Where the state asserts it had the right to search the defendant despite the absence of a warrant because the defendant consented to the search, the state has the burden to prove that consent was freely and voluntarily given."). "The determination of whether the consent to search is voluntary is a question for the trial judge and should not be disturbed on appeal unless the determination is clearly erroneous." Towner v. State, 713 So.2d 1030, 1031 (Fla. 5th DCA 1998) (citing Davis v. State, 594 So.2d 264 (Fla.1992)). Based on the testimony presented by the State, the trial court specifically found that Kindle freely and voluntarily consented to a search of his vehicle. Our review of the record leads us to conclude that the State presented competent substantial evidence to support this finding.
Kindle, however, complains that since the consent was given after the citation was issued, it was invalid and subjects the drugs found in his possession to suppression because there was no reasonable suspicion that criminal activity was committed or was about to be committed. As did the trial court, Kindle relies heavily on the decision in Gilchrist to support his argument.
We find that the trial court's and Kindle's reliance on Gilchrist is misplaced. We need not say whether we agree with *975 the decision in Gilchrist because we find it is distinguishable from the instant case and thus inapplicable. In Gilchrist, after issuing a citation, the officer asked the appellant to exit the vehicle prior to seeking his consent to search. The officer testified that he asked the appellant to get out of the vehicle "to prove that [he] wasn't detaining him." 757 So.2d at 583. In concluding that the search was unlawful, the First District stated, "[A]sking a person to exit a vehicle in order to talk to him (not as a safety measure during a legitimate traffic stop) is a show of authority that goes beyond a consensual encounter." Id. at 583-84 (citing Popple v. State, 626 So.2d 185, 188 (Fla.1993)). In the instant appeal, Kindle exited the vehicle prior to both the issuance of the citation and the request to search. Thus, the encounter was not a show of authority that went beyond a consensual encounter as happened in Gilchrist.
We find that the decision in Cromatie is analogous to the instant case. In Cromatie, an officer was patrolling and observed a car with an inoperable left rear brake light roll through a stop sign. The officer stopped the car, informed the occupants of the reason for the stop, had them remain in the vehicle and ran their driver's licenses through a computer check which produced negative results. The officer then issued two citations for the traffic violations to the driver. Thereafter, the officer asked the driver if there was anything illegal in the car and if he could search the car. The driver consented to the search. The search produced a cigarette package containing several pieces of folded aluminum foil whose contents tested positive for cocaine.[2]
On appeal, the appellee in Cromatie argued that the stop which began as a valid traffic stop turned into an illegal stop because it was prolonged beyond its lawful purpose once the citations for the two traffic violations were issued. The Second District rejected that argument, finding that "[i]t is the consent given by the driver to the search of his car ... which eventually led to the discovery of the appellee's possession of cocaine, which legalizes these events and shields the evidence from suppression." 668 So.2d at 1076. The court held that "[d]uring a valid traffic stop, or even if a valid traffic stop has had its lawful function completed and turns into a citizen encounter, there is no reason a law enforcement officer cannot ask for consent to search." 668 So.2d at 1077. We find this to be a correct statement of the law. Moreover, as this court explained in Watson v. State, 689 So.2d 1090 (Fla. 5th DCA), rev. denied, 697 So.2d 513 (Fla. 1997), in response to the appellant's contention that the query by law enforcement as to the presence of weapons or drugs after appellant's driver's license was returned made the detention illegal:
It is not determinative whether the stop had ended before this question was asked, as the defendant argues. The officer could have asked this question even if the stop had ended and the two had merely been engaged in a citizen encounter. See Bostick v. State, 593 So.2d 494 (Fla.1992).
*976 Id. at 1092 n. 2; see also State v. Vera, 666 So.2d 576 (Fla. 2d DCA 1996).
In the instant appeal, the trial court found that the traffic stop effectuated by Rhodes was lawful. After Rhodes issued the citation, the traffic stop turned into a citizen encounter. Thus pursuant to Cromatie, there was no reason Rhodes could not ask Kindle for consent to search the vehicle. We conclude that the fact that consent was given after the citation was issued does not invalidate the consent or the search.
REVERSED and REMANDED.
THOMPSON, C.J., and HARRIS, J., concur.
NOTES
[1]  Thompson also testified at the suppression hearing. He stated that upon his arrival at the scene, Rhodes was still issuing the citation to Kindle. Further, Thompson testified that he did not hear Kindle consent to the search. However, he did state that he was standing away from Rhodes and Kindle.
[2]  Based on this finding, the driver and the appellee [the passenger] were taken into custody and placed in separate patrol cars. Upon questioning, the driver admitted that the cigarette pack belonged to him but denied any knowledge of the drugs contained in it. Because the driver admitted to owning the cigarette pack, the officer decided to release the appellee. However, after the appellee emerged from the back seat of the patrol car, an officer checked the patrol car and found cocaine. Based on this second finding of cocaine, the appellee was arrested. In Cromatie, it was the evidence of cocaine found in the back of the patrol car which the trial court suppressed.
