McDonald's will pay $26 million to resolve claims the fast-food chain skimmed wages from some 38,000 workers at corporate-run stores across California.

The preliminary accord settles a years-long legal battle that began in 2013 when Los Angeles McDonald's worker Maria Sanchez filed suit against the company, with three other employees then signing on. The suit accused McDonald's of wage theft as far back as 2009, according to the agreement, distributed by the labor group Fight for $15 and a Union.

The suit alleged McDonald's violated California overtime law, which requires workers be paid overtime when working more than eight hours in a 24-hour period. The fast-food company, however, structured its timekeeping to skirt the law by attributing all hours to the day a shift started, as opposed to when the work was actually performed. Employees were not given meal or rest breaks when restaurants were busy, with off time only granted at the start and end of shifts, the suit maintained.

Get Breaking News Delivered to Your Inbox

The suit was filed on behalf of some 38,000 people employed at stores owned and operated by McDonald's. (Just 5% of McDonald's 14,000 U.S. restaurants are owned and operated by the company; the vast majority are run by franchisees.)

"McDonald's cheated us out of tens of millions, but by standing up and speaking out, we're holding the world's second largest employer accountable for breaking the law," Rosario Mercado, who works at a corporate-owned McDonald's restaurant in Los Angeles, stated Monday in a news release.

McDonald's vows "continued compliance with all wage and hour laws"

McDonald's said it decided to resolve the lawsuit even though it did not believe it had violated the state's labor law.

"The parties have reached a mutually acceptable resolution and have submitted the settlement to the court for its review and approval," the company emailed. "McDonald's remains committed to our employees, and we continuously roll out additional trainings and resources across corporate-owned restaurants to promote continued compliance with all wage and hour laws."

McDonald's in recent days reportedly agreed to resolve allegations it miscalculated 10 years of holiday pay for employees in New Zealand, paying what could amount to tens of millions of dollars.

The work environment for McDonald's workers is also at the center of recently filed litigation. Last week 17 McDonald's workers in Chicago filed suit against the company, claiming it had not taken ample steps to protect them from what they called a "nationwide pattern" of violence at its restaurants.

Employees at one McDonald's outlet in Chicago in May filed a report with the Occupational Health and Safety Administration, saying their workplace had been the scene of 31 violent incidents over six months during the past year.

And earlier this month, a former McDonald's employee filed a proposed class-action lawsuit against McDonald's and one of its Michigan franchisees over alleged sexual harassment. The suit came a week after McDonald's fired CEO Steve Easterbrook for violating a policy forbidding relationships between supervisors and their subordinates.