
873 So.2d 602 (2004)
STATE of Florida, Appellant,
v.
Raymond WILLIAMS, Appellee.
No. 5D03-2374.
District Court of Appeal of Florida, Fifth District.
May 28, 2004.
*603 Charles J. Crist, Jr., Attorney General, Tallahassee, and Carmen F. Corrente, Assistant Attorney General, Daytona Beach, for Appellant.
James B. Gibson, Public Defender, and Marvin F. Clegg, Assistant Public Defender, Daytona Beach, for Appellee.
SHARP, W., J.
The state appeals from the trial court's order which dismissed the charge of possession of cocaine against Williams. We reverse.
The state charged Williams with possession of cocaine[1] and driving while his license was suspended or revoked.[2] He filed a motion to dismiss the possession charge pursuant to Florida Rule of Criminal Procedure 3.190(c)(4) on the ground that there are no material disputed facts underlying this charge against him, and that they do not establish a prima facie case of guilt. Williams' statement of facts are set forth in his motion, and they were not disputed (traversed) by the state. In fact, the prosecutor collaborated with defense counsel in the wording of the facts *604 and both attorneys agreed to their accuracy.
The statement of facts were as follows:
1. That on or about March 12, 2001, the defendant was operating a motor vehicle that belonged to Marcus Oliver and was stopped by the police.
2. That at the time of the stop, the defendant was told to exit the vehicle.
3. That according to the testimony of the officer, they looked in the area of the car and did not see any items on the ground when he arrived on the scene.
4. That after the defendant exited the vehicle, it was noticed there was a cigar tube lying on the ground.
5. That there was also discovered, inside the car, many similar cigar tubes.
6. When the item was picked up from the ground, there were several rocks of what appeared to be crack cocaine inside the tube.
7. The tube was not tested for fingerprints to determine if the defendant had dropped the tube and the defendant was not seen discarding the tube.
8. That there are no other facts or evidence to connect the defendant to the cigar tube or the items found inside the tube.
The function of a "c4" motion to dismiss is to require the state to present a prima facie case of guilt against the accused, similar to a summary judgment situation in a civil case. State v. Williams, 539 So.2d 575 (Fla. 5th DCA 1989); State v. Pentecost, 397 So.2d 711 (Fla. 5th DCA 1981). If the undisputed facts do not legally constitute prima facie proof of the crime charged, or if they affirmatively establish a valid defense, a motion to dismiss should be granted. However, if the undisputed facts permit the conclusion the defendant could be found guilty of the charged crime, the motion must be denied. Williams; State v. Upton, 392 So.2d 1013 (Fla. 5th DCA 1981).
All reasonable inferences that arise from the undisputed facts must be taken in a light most favorable to the prosecution's case. State v. Fuller, 463 So.2d 1252 (Fla. 5th DCA 1985); State v. Raulerson, 403 So.2d 1102 (Fla. 5th DCA 1981). Prior to Williams alighting from his vehicle, the law enforcement officer specifically noted there was nothing on the ground. After Williams got out of his car, the tube containing what appeared to be cocaine rocks was found. Other tubes like the one found on the ground were found inside the car. In this case, we think the undisputed facts are sufficient to support a reasonable inference that the cigar tube found on the ground came from Williams or from inside his vehicle, which was (under the stated facts), in his sole possession. Thus, Williams' possession of the contraband immediately before it was discovered by the officer, can reasonably be inferred from the undisputed facts in this case.
REVERSED and REMANDED.
SAWAYA, C.J., and TORPY, J., concur.
NOTES
[1]  § 893.03(2)(a)4., Fla. Stat.
[2]  § 322.34(2)(a), Fla. Stat.
