(Reuters) - Lowe's Cos LOW.N has reached an $8.6 million settlement of a U.S. agency lawsuit accusing the nation's second-largest home improvement retailer of illegally firing workers who went on medical leave for a long time.

A view of the sign outside the Lowes store in Westminster, Colorado February 26, 2014. REUTERS/Rick Wilking

The accord resolves Equal Employment Opportunity Commission claims that Lowe’s violated the Americans with Disabilities Act by terminating employees whose medical leaves of absence exceeded the company’s 180- or 240-day maximum leave policy.

A consent decree detailing the settlement was approved on Thursday by U.S. District Judge Andre Birotte in Los Angeles.

It requires Lowe’s to retain consultants to oversee its leave of absence policies, and track workers’ requests for accommodations. The Mooresville, North Carolina-based company also agreed to improve employee training.

Lowe’s denied wrongdoing in agreeing to settle. The decree lasts for four years.

The accord sends a “clear message” that automatically firing disabled workers who reach rigid limits on leaves of absence may be illegal, EEOC General Counsel David Lopez said.

Karen Cobb, a Lowe’s spokeswoman, said the company updated its leave of absence policies in 2010, and has since taken steps “to ensure consistency in applying our policies and help employees manage their leaves of absence and accommodations.”

The EEOC said anyone Lowe’s fired between Jan. 1, 2004 and May 13, 2010 after taking maximum leave may pursue a claim.

The case stemmed from EEOC charges filed between 2007 and 2010 that Lowe’s fired three workers after unreasonably refusing to grant them extended medical leave.

The case is U.S. Equal Employment Opportunity Commission v Lowe’s Cos et al, U.S. District Court, Central District of California, No. 16-03041.