Police in Massachusetts can still arrest people for driving under the influence of marijuana if the officer observes signs of use.

The state Supreme Judicial Court made that finding in a ruling issued Monday as more and more retail marijuana shops pop up across Massachusetts.

The ruling involved Mark J. Davis, a man who was arrested July 2015 on the Massachusetts Turnpike after he was pulled over by Massachusetts State Police.

Troopers pulled over Davis as he sped along the highway at 80 mph and tailgated other cars, the ruling states.

Davis was driving and had two people inside the car. The trooper detected a “strong odor of burnt marijuana and an odor of fresh marijuana” inside the car, according to the ruling.

Davis also smelled like pot.

A jury acquitted Davis on drugged driving and gun possession charges, but he was found guilty on a drug possession charge.

Davis appealed his arrest based on the search of his car after the arrest.

When troopers seized and searched the car, they found oxycodone, cocaine and a gun, records said.

Davis argued troopers did not have probable cause to arrest him for driving under the influence of marijuana and therefore the search of the car was not lawful.

But the SJC said the initial arrest for driving under the influence of marijuana was legit based on the trooper’s observations during the traffic stop.

Along with the odor of burnt marijuana, Davis had “red and glassy eye” and struggled to keep his eyes open, the trooper reported at the time. Davis had difficulty focusing and following “simple directions,” the trooper further noted.

“The defendant told the officer that he had smoked marijuana earlier that day, before he left to drive to Somerville,” according to the ruling.

Tucked in the opinion is a statement by the SJC about the difficulty police face when trying to determine if someone is under the influence of marijuana.

“We acknowledge that it is often difficult to detect marijuana impairment, because the effects of marijuana consumption ‘vary greatly amongst individuals,’ ” the SJC wrote.

There are no validated field sobriety tests in terms of drug use, the ruling adds.

The SJC also ruled troopers were justified in searching Davis’ car without a warrant under an automobile warrant exception.

It was that search that led to the discovery of the gun and drugs. The drug possession conviction was upheld in the SJC’s ruling.

Davis’ trial lawyer told jurors to, “Go ahead and find him guilty of the drugs in the glove box. Those are his,” according to the ruling.

The lawyer argued at trial that Davis should not be found guilty of the drugged driving and gun charge. The jurors agreed.