SAN FRANCISCO (CBS SF) — The California Supreme Court ruled unanimously in San Francisco Thursday that Apple Inc. workers must be paid for the time they spend undergoing searches of their bags and iPhones when they leave work.

The mandatory searches, including waiting time for a supervisor to conduct the probe, typically take 5 to 20 minutes and sometimes up to 45 minutes, according to evidence in a lawsuit filed against Cupertino-based Apple by a group of employees.

The high court said the time workers spend on searches qualifies as “hours worked” under state law because the employees are under the control of Apple and required to stay on the premises until the search is completed.

Chief Justice Tani Cantil-Sakauye wrote, “It is clear that plaintiffs are subject to Apple’s control while awaiting, and during, Apple’s exit searches.

“Apple’s exit searches are required as a practical matter, occur at the workplace, involve a significant degree of control, are imposed primarily for Apple’s benefit, and are enforced through threat of discipline,” Cantil-Sakauye wrote in the court’s opinion.

The lawsuit was originally filed in U.S. District Court in San Francisco, where a federal judge ruled in favor of Apple. After the plaintiff workers appealed to the 9th U.S. Circuit Court of Appeals, the appeals court asked the California Supreme Court to decide whether state law requires compensation for search time.

The case will now return to the federal court system for completion.

A spokesperson for Apple was not immediately available for comment.

© Copyright 2020 CBS Broadcasting Inc. and Bay City News. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed