A Fort Morgan meatpacking plant and the union that represents its employees will pay settlements to Muslim workers whose civil rights were violated when they were denied prayer breaks and then fired after they complained.

Cargill Meat Solutions will pay $1.5 million and the Teamsters Local Union No. 455 will pay $153,000 to resolve complaints filed in 2015 after the Somali-American workers walked off the job over the prayer breaks dispute, the U.S. Equal Opportunity Employment Commission announced in a news release Friday.

The company and the union did not accept the EEOC’s findings that they discriminated against the employees because of their religion, but decided to settle to avoid lengthy legal proceedings.

Cargill now allows prayer breaks and provides designated areas for the workers to practice their religion. The breaks take into account production line needs and food safety requirements.

The settlement will be paid to 138 people, said Amy Burkholder, director of the EEOC’s Denver office. The company and the union have agreed to change policies and to provide training to managers and union representatives as part of the settlement, she said.

“We’re happy with Cargill and the Teamsters for changing policies,” Burkholder said. “It brings them in line with our laws.”

Based on the settlement, each worker will receive about $12,000 before attorneys’ fees and costs are subtracted. The workers also were represented by the Council on American-Islamic Relations.

About two dozen of the workers who filed complaints continue working for Cargill, said Qusair Mohamedbhai, a Denver lawyer who represented the workers. The others found employment elsewhere.

“We applaud this settlement, which represents a mutually agreeable resolution of this case, and we welcome Cargill’s commitment to accommodating the religious needs of Muslim workers and workers of other faith backgrounds,” Lena Masri, CAIR’s national litigation director, said in a statement.

The dispute began in 2015 when Muslim workers, most of whom immigrated from Somalia, complained about their supervisors at the Fort Morgan plant denying prayer breaks. More than 200 workers walked off the job to protest their treatment, and three days later Cargill fired them. Over the three years the dispute has played out, the workers have prevailed in every legal challenge.

In August 2016, the Colorado Department of Labor ruled the fired workers were eligible for unemployment compensation. The labor department would not reveal the amount each worker qualified to receive, but the maximum benefit per claim was $8,841 at the time.

Cargill had challenged the unemployment claims but dropped its appeals after losing 20 cases.

In August 2017, the EEOC sided with the 138 employees who had filed complaints against Cargill and 20 workers who had filed complaints against the Teamsters. Both were invited to participate in mediation.

The union failed to represent the workers because its leadership did not pursue grievances on their behalf to Cargill, the EEOC determined. It was a rare instance where a labor union was found in violation of federal civil rights laws.

Throughout the dispute, Cargill maintained that it always had allowed its workers who practice Islam to take breaks for prayer. That stance continued Friday after the settlement’s details were announced.

“Providing our employees with religious accommodation is an important part of engaging and supporting our employees, and our policy has remained consistent for more than 10 years,” Brian Sikes, the company’s president, said in a statement.