HARRISBURG, Pa. (AP) — The Pennsylvania Supreme Court says the smell of marijuana can be a factor police use to justify a search without a warrant but can’t be the sole basis for it.

The state’s top court ruled Wednesday that a state police search of a vehicle in Allentown three years ago was conducted only because the troopers smelled marijuana.

A trial court had ruled the search unconstitutional and said the evidence it produced was not able to be used in court, and dismissed the charge of possession of a small amount of marijuana.

The Supreme Court majority reinstated the order suppressing the evidence.