The U.S. Supreme Court today affirmed the validity of traffic stops made by officers who administer them based on a mistaken understanding of the law—provided the mistake was reasonable.

The case, Heien v. North Carolina, originated in Surry County, when an interdiction officer pulled over a car with a broken taillight, mistakenly believing that the law required two functioning taillights when in fact it did not. The officer, who searched the car, discovered cocaine, and the motorist was charged and convicted with drug trafficking. The N.C. Court of Appeals reversed the ruling, but the N.C. Supreme Court reversed it back. The U.S. Supreme Court heard oral arguments on the case in October.

The Supreme Court justices sided with the State in an 8-1 split, with Justice Sonia Sotomayor voicing the lone dissent. In his majority opinion, Chief Justice John Roberts wrote that because the officer’s mistake of the law was reasonable, it did not violate the motorist’s 4th Amendment rights.

“To be reasonable is not be perfect, and so the Fourth Amendment allows for some mistakes on the part of government officials, giving them ‘fair leeway for enforcing the law in the community’s protection,’ ” Roberts wrote.

The notion that the law “is definite and knowable sits at the foundation of our legal system,” Sotomayor said in her dissenting opinion. “And it is courts, not officers, that are in the best position to interpret the laws.”