TRENTON -- New Jersey's highest court ruled on Wednesday that an Essex County sheriff's officer violated the state constitution when he pulled over a motorist for using high beams when there were no other cars on the road.

The state Supreme Court upheld a trial court ruling suppressing weapons evidence found on the passenger of the vehicle, Al-Sharif Scriven, because it was the product of an unreasonable search.

The case stemmed from a November 2013 incident in which the sheriff's officer, David Cohen, was waiting for a tow truck to remove an unregistered vehicle from a Newark street around 3 a.m.

As he waited, Cohen saw a car stop at a nearby stop sign with its high beams on. He flagged the car down with a flashlight and, smelling marijuana through the car window, asked Scriven to step out of the car.

Scriven then told him he had a gun under his jacket, court documents show.

Scriven was charged with unlawful possession of a handgun, possession of hollow-nose bullets and a large-capacity magazine and receiving stolen property. But at trial, the court agreed to his request to suppress the evidence because the stop was unconstitutional. An appeals court later upheld that decision.

The issue was that the officer testified the car Scriven was in was the only one in the area at the time of the stop. He said, however, that the use of high beams "always sends up a red flag" and that he intended to give the driver a verbal warning until he smelled the marijuana, court documents show.

He also said drivers of stolen cars frequently drive with high beams on and that their use removes an officer's "tactical advantage" to see weapons inside a car on approach.

Justice Barry Albin wrote in the unanimous decision that the state law against using high beams "applies only when there is an 'oncoming vehicle' operated by an 'oncoming driver'"

"The statute does not state that high beams may be used only on rural or unlit suburban roads at night, but not on a seemingly well-lit deserted city street at 3:30 a.m.," the justice wrote.

Alison Perrone, Scriven's public defender, said Wednesday the ruling was important because the officer's basis for the high beam stop was too broad.

"Under that interpretation, it would be legally permissible to stop anyone at any time for using their high beams," she told NJ Advance Media.

In a statement, Assistant Essex County Prosecutor Frank Ducoat disagreed with the decision.

"This brief motor vehicle stop was necessary to ensure officer and public safety and we are disappointed the court chose not to see it that way," he said.

S.P. Sullivan may be reached at ssullivan@njadvancemedia.com. Follow him on Twitter. Find NJ.com on Facebook.