We're told the border patrol ran a standard inspection of the bus with the dog ... when the animal alerted the agents to a possible hit in a waste basket in the back of the vehicle.

The agents claim they found a red prescription bottle with several joints inside. We're told the bottle contained under a half-ounce of weed.

Cops say Snoop admitted the dope belonged to him. Snoop has a prescription for cannabis in California, but law enforcement tells us, there is a zero tolerance policy for weed in Texas ... regardless of his status in other states.

Snoop was issued a citation for misdemeanor drug possession and released.

Attempts to reach the rapper's rep were unsuccessful.

1:25PM PT: The Justice of the Peace in Hudspeth County, TX tells TMZ, Snoop can resolve the entire matter by paying a $537 fine ... unless he wants to challenge the citation, in which case he can make his case in court.