Home Depot, the nation's largest home improvement chain, agreed Friday to pay $65 million to female employees and job applicants in 10 Western states to settle a sex discrimination suit.

The settlement, subject to a federal judge's approval, covers as many as 20,000 to 25,000 past and present employees and several thousand unsuccessful job applicants, said lawyers for the women. It also includes $22.5 million in legal fees and costs.Home Depot said it also agreed to spend $17 million to upgrade its employment programs nationwide and settle three other discrimination suits by individual employees in Louisiana and New Jersey. The U.S. Equal Employment Opportunity Commission has sought to intervene on the side of the women in one of the Louisiana cases.

The company said it expects to take a pre-tax charge of $104 million, or 8 cents per share after taxes, against third-quarter earnings to cover the settlement.

Home Depot, based in Atlanta, has 536 stores in the United States and 31 in Canada, employs 118,200 people and reported sales of $19.5 billion in 1996. The West Coast Division has 140 stores in California, Arizona, Nevada, Oregon, Washington, Idaho, Utah and Colorado, with 25,000 employees, including 8,000 women.

The suit, filed in 1994, accused the company of discriminating in hiring, pay and promotions. It said women were confined to menial jobs, were denied training and were paid less than men, and that women expressing an interest in management were not hired.

One of the eight original plaintiffs, Jacqueline Genero, said when the suit was filed that she had been chosen by co-workers as the Colma, Calif., store's first female "employee of the year" but was denied the $500 bonus paid to male recipients. She said she made $8 an hour while men doing the same work earned $16 or more.

U.S. District Judge Susan Illston approved the San Francisco suit as a class action in 1995. Home Depot appealed unsuccessfully to the 9th U.S. Circuit Court of Appeals and the Supreme Court, which denied review this March. Lawyers said they would submit the settlement to Illston next week for preliminary approval of its fairness.

Damages under the settlement would be paid to West Coast female employees since Nov. 5, 1992, who expressed an interest in promotions to sales or management jobs, said Richard Heimann, a lawyer for the women. He said the settlement would also cover applicants for sales jobs during the same period who met the company's qualifications but were not hired.

Home Depot also agreed to strengthen its management training and complaint systems for sex discrimination and to allow employees to formally express interest in promotions to sales and management posts.