Evidence seized during a traffic stop can be used in court even if a police officer pulled the car over based on a misunderstanding of the law, the Supreme Court ruled Monday,

The justices considered the appeal of Nicholas Heien, a North Carolina man who was stopped by police in 2009 because of a broken brake light, even though the state only requires one brake light to be functioning, Fox News reports. Heien subsequently consented to the search of his car, where police found a sandwich bag of cocaine. He pleaded guilty to drug charges and was sentenced to a two-year prison term.

A state appellate court later ruled that the traffic stop was impermissible, a ruling that may have allowed Heien to overturn his conviction for drug trafficking by suppressing the drug evidence found in his car.

Tthe North Carolina Supreme Court reversed the verdict, however, saying that the officer's mistaken understanding of the brake-light requirements was "reasonable." In an 8-1 decision, the nation's highest court agreed, finding that the Constitution requires officers to act reasonably but not perfectly.

"(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,'" Chief Justice John Roberts wrote for the court. "Reasonable suspicion arises from the combination of an officer's understanding of the facts and his understanding of the relevant law. The officer may be reasonably mistaken on either ground."

Justice Sonia Sotomayor was the lone dissenter, NBC News noted. She argued that a mistake on the law, no matter how reasonable, "cannot support the individualized suspicion necessary" to justify an arrest.

The confusing way in which the North Carolina law in question was written contributed to the "reasonableness" of the officer's misinterpretation, the remaining justices argued. The statute requires that cars in the state have a "stop lamp" that can be part of "one or more other rear lamps."

"I suspect most of you here were surprised to learn that only one brake light is required in North Carolina, even if you are from North Carolina," Roberts said.