Employers in California who guard their premises with security gates must pay their employees for the time they spend driving to the gates and being searched, the state Supreme Court ruled Monday. The court also required pay for time that employees are required to stay on company property during lunch breaks.

The decision came four years after the court ruled unanimously that employers like Apple who search their workers’ bags when they go home must pay them for the time spent on the search. Monday’s ruling went further and required compensation for time spent driving to a security checkout, searches of the employee and vehicle and meal breaks that must be spent at the office.

“An employee who is subject to the control of an employer does not have to be working during that time to be compensated,” Justice Goodwin Liu wrote in the 7-0 ruling. While state law does not entitle employees to be paid for time commuting to and from work, Liu said, driving from work to a security gate, and being searched before leaving, is not part of commuting.

The ruling particularly affects workers in construction, mining and other industries that search people entering and leaving the premises to make sure they are employees and are not taking equipment with them. The company in this case, CSI Electrical Contractors, employs construction workers at a solar power facility on private land in Monterey and San Luis Obispo counties.

At least 1,000 workers at CSI go through the daily security checks, and similar suits are pending against other companies in California, said Peter Kindem, lawyer for an employee who challenged the company’s denial of compensation. With cars lined up at the security gate, the employee said it took 10 to 15 minutes to travel from the gate to the parking lot, and anywhere from five to 30 minutes to drive back to the gate and be searched.

“There are many employer-mandated security processes that are unpaid for,” Kindem said after the ruling. “We’re attempting to protect workers’ rights to be paid for all hours worked.”

A lawyer for the company could not be reached for comment. Attorney George Howard, who has represented employers in other cases for more than 40 years, said the ruling, while unfavorable for employers, offered some guidance on reducing their liability.

Companies “should review the specific workplace to reduce so far as possible the time required for employees to exit the workplace and the amount of ‘control’ imposed on the exiting employees,” Howard told the Chronicle. And to avoid another half hour of pay, he said, “do not control employees’ activities during their off-duty meal periods.”

CSI’s contract with its workers’ labor union included an unpaid half-hour meal break each day. But the court said California’s minimum wage law applies to any time in which an employee is prohibited from leaving the workplace.

“Even at remote worksites, there is a meaningful difference between being required to eat at one’s workstation or in a designated meal area and being allowed to return to one’s personal vehicle or take a walk,” Liu said.

Although the court cited the state’s minimum wage law, which currently requires pay of $16 an hour, Kindem said he would argue for compensation at the workers’ regular pay scale for lunch periods when they were prohibited from leaving.

The case is Huerta v. CSI, No. S275431.

Reach Bob Egelko: begelko@sfchronicle.com; Twitter: @BobEgelko