Apple didn’t want to pay hourly workers for the time spent searching their bags. It has now settled a $30.5 million lawsuit

A California judge has approved a $30.5 million settlement by Apple following a decade-long court battle after store employees were forced to stay after work for mandatory bag checks.

Back in 2013 when the case first opened, Apple store employees in California had been subject to routine bag checks after their shifts, described as “embarrassing and demeaning,” to make sure they hadn’t taken any valuable items. Checks could take up to 45 minutes of employees' time.

Two staff members took legal action, arguing that the bag checks were compensable under state law. In 2015, the case ended when Apple argued that employees were at liberty to leave their bags at home to avoid checks.

Case reopened

However, the case was reopened after plaintiffs appealed, and peaked in February 2020 when the court dismissed Apple's argument on the basis that employees were required by the company to change out of uniform or hide the Apple logo outside of work hours. This meant they had to carry their uniform with them or bring a change of clothes in a bag.

Apple agreed to a settlement of $30.5 million for the 14,683 hourly-rate employees who were subject to these mandatory bag checks between July 2009 and December 2014, an amount that has now been approved by Judge William Alsup of the U.S. District Court for the Northern District of California.

“Under the circumstances of this case and the realities of ordinary, 21st-century life, we find far-fetched and untenable Apple’s claim that its bag-search policy can be justified as providing a benefit to its employees,” the court said.

Fortune has reached out to Apple for comment.

It is not the first time that employees for large retail brands have received compensation in similar lawsuits.

Last year, Amazon and a staffing agency paid $8.7 million to 42,000 warehouse workers, according to Reuters.

This story was originally featured on Fortune.com