Apple Inc., has defeated a U.S. class action lawsuit brought forward by five Apple retail workers over off-the-clock bag searches practices at the company's California brick and mortar outlets, avoiding a near $60 million payout, a court ruling on Saturday revealed.

The decision came from U.S. District Judge William Alsup in San Francisco in the case where employees sued to be reimbursed for the time Apple takes to search their bags to ensure that no merchandise has been stolen, according to Raw Story.

The lawsuit was filed more than two years ago on behalf of more than 12,400 workers at 52 California Apple outlets. One plaintiff alleges that waiting longer than five to then minutes for the screenings added up to roughly $1,500 in lost wages per year.

However, Alsup determined that the anti-theft screenings were not part of the employees' job responsibilities, and could have been avoided by not bringing a bag to work.

"Apple could have alleviated [theft concerns] by prohibiting its employees from bringing personal bags or personal Apple devices into the store," He wrote, according to Bloomberg. "Instead, Apple took the lesser step of giving its employees the optional benefit of bringing such items to work, which comes with the condition that they must undergo searches upon leaving the store."

Furthermore, he noted that no Apple employee filed court papers asserting a special need to bring a bag. Apple declined to comment on the result of the ruling.

Emails unsealed in June reveal that some of the workers took their complaints directly to CEO Tim Cook, telling him the bag-check practice was embarrassing and belittling.

It's unclear if lawyers for the plaintiffs plan to appeal. The case in U.S. District Court, Northern District of California is Amanda Frlekin et al. vs. Apple Inc., 13-cv-03451.