Walgreen Co. will pay $20 million to settle a federal lawsuit alleging widespread racial bias at the nation’s largest drugstore chain under the terms of a proposed deal announced Thursday.

The U.S. Equal Employment Opportunity Commission filed the class action lawsuit in March, alleging that Walgreen, based in Deerfield, Ill., discriminated against thousands of black workers in hiring and assignment decisions.