A 116-year-old municipal law that allowed police to scour hotel guest registries without a warrant has been ruled as an unconstitutional violation of privacy by the US Supreme Court.

In a 5-4 decision in the case of City of Los Angeles v. Patel, the justices said that an 1899 law in Los Angeles, California did not allow hotel owners an opportunity to challenge warrantless police searches.

The law “penalizes them for declining to turn over their records without affording them any opportunity for precompliance review,” Justice Sonia Sotomayor wrote in the majority's decision.

“A hotel owner who refuses to give an officer access to his or her registry can be arrested on the spot,” she noted.

“The court has held that business owners cannot reasonably be put to this kind of choice."

Los Angeles hotel operators have been required to keep on record for 90 days guests' names, addresses, vehicles, and other information, and to offer the data to police without a warrant. Motel owners sued the city over the law in 2003, claiming it violated their Fourth Amendment privacy rights.

Wow. The Supreme Court distinguished Sibron, the 1968 case that says Fourth Amendment too fact bound for facial challenge. #patel — Ryan Calo (@rcalo) June 22, 2015

LOVE what the Supreme Court just did in Los Angeles v. Patel. You can now raise facial challenges to a statute under the Fourth Amendment. — Leon Wolf (@LeonHWolf) June 22, 2015

In the court's opinion, Sotomayor wrote that a hotel owner must be offered “an opportunity to have a neutral decisionmaker review an officer’s demand to search the registry before he or she faces penalties for failing to comply.

“Actual review need only occur in those rare instances where a hotel operator objects to turning over the registry," she added.

Privacy advocates believe the decision may open the door for new opportunities to challenge government abilities to search private companies' records. The American Civil Liberties Union Deputy Legal Director Jameel Jaffer, for example, approved of the decision.

Today's #SCOTUS dec'n in Patel, which holds hotel-inspection statute facially unconstitutional, is a big deal. http://t.co/wdelJ7b2TU — Jameel Jaffer (@JameelJaffer) June 22, 2015

Sotomayor was joined in the majority by Justices Anthony Kennedy, Ruth Bader Ginsburg, Stephen Breyer, and Elena Kagan. Conservative Justices Antonin Scalia, Clarence Thomas, Samuel Alito, and Chief Justice John Roberts were in opposition.

Writing the court's dissenting opinion, Scalia said motels were like other "closely regulated business" that should be exempt from the US Constitution's warrant requirement. Motels are a hub of criminal activity, he said, and the government must be allowed to search its records without warrant approval.

“The private pain and public costs imposed by drug dealing, prostitution, and human trafficking are beyond contention, and motels provide an obvious haven for those who trade in human misery,” Scalia wrote.

“The warrantless inspection requirement provides a necessary incentive for motels to maintain their registers thoroughly and accurately: They never know when law enforcement might drop by to inspect.”