A major U.S. meatpacking company has agreed to pay $1.5 million to settle charges of discrimination involving Muslim workers who walked off the job in a dispute over prayer breaks.

The U.S. Equal Employment Opportunity Commission announced the financial settlement Friday after several years of litigation between Cargill Meat Solutions Corporation and 138 Muslim workers, most of whom were Somali immigrants.

The dispute began in late 2016 after the workers were fired following a three-day walkout at a meatpacking plant in Fort Morgan, Colorado.

Management had changed policies allowing Muslim workers to take short prayer breaks.

The EEOC said it had "reasonable cause to believe that Somali, African and Muslim employees were harassed, denied their requests for prayer breaks and fired."

Cargill disagreed but said it settled the case to avoid further litigation. The company also said it was committed to allowing "Muslim workers to take short breaks to perform their obligatory prayers."

A Teamsters union chapter representing the workers will pay them $153,000 to settle discrimination complaints related to the dispute. The EEOC said Teamsters Local 455 had failed to advocate for the workers — who were dues-paying union members — and had harassed them because of their race, religion and national origin.

The union denied wrongdoing but also agreed to give their union officials grievance training and to publicize employee rights to work in an environment free of discrimination.

The Council on American-Islamic Relations applauded the settlements, as did Denver lawyer Qusair Mohamedbhai, who represented the workers.

"We are gratified with the settlement reached for the 138 former Cargill employees that we represented in this proceeding and applaud the company for its ongoing efforts to consistently grant prayer requests to people of all faiths based on its long-standing policy and values," Mohamedbhai said.