Wells Fargo’s $240 million financial settlement will be paid by by insurers covering up to 20 current and former directors and officers, including retired chairman and chief executive John Stumpf and former chief executive Timothy Sloan.

A federal judge has approved a $240 million financial settlement involving Wells Fargo & Co.’s sales practices and a shareholder lawsuit in Northern California.

The bank disclosed the approval in a regulatory filing Tuesday. An Aug. 1 hearing will be held on the settlement in San Francisco. The money would be paid by the bank within 30 days of final approval.

Wells Fargo revealed the settlement amount in a March 1 quarterly regulatory filing. The amount was agreed upon Dec. 12.

“This represents another step in our work to finalize the settlement and put the matter behind Wells Fargo,” the bank said in a statement Tuesday.

The payment will be made by insurers covering up to 20 current and former directors and officers, including retired chairman and chief executive John Stumpf and former chief executive Timothy Sloan, who stepped down March 28.

The bank will pay the plaintiffs’ attorneys fees, estimated at $68 million. Lead plaintiffs will receive up to $25,000 each.

Stumpf retired just a month after heated cross-examination before the U.S. Senate banking committee.

Although the revamped Wells Fargo board of directors supported Sloan becoming CEO in October 2016, he faced numerous calls for his firing, most publicly from U.S. Sen. Elizabeth Warren, D-Mass., a 2020 Democratic presidential candidate.

Sloan said March 28 that he resigned in large part to stop being a distraction for the bank. Wells Fargo has not set a deadline for hiring its next chief executive.

On May 15, the bank’s federal regulator told the U.S. Senate banking committee that it will vet the bank’s next chief executive nominee. However, the regulator, Joseph Otting, the head of the Office of the Comptroller of the Currency, said the review won’t be made public.

The projected settlement means Wells Frgo has paid or agreed to paay close to $3.9 billion in regulatory fines.

The latest settlement involved several shareholder lawsuits focused on how the bank handled derivatives.

A derivative is a financial instrument whose value is based on — or is derived from — an asset or group of assets. A derivative is a contract between two or more parties, and its price is determined by fluctuations in the underlying asset.

The Wells Fargo disclosure said the lawsuits claimed “breach of fiduciary duty” by defendants “for their alleged failure to detect and prevent sales practices issues.”

The defendants denied wrongdoing in the lawsuits, saying “they acted in good faith and in a manner they reasonably believed to be in the best interests of Wells Fargo and its shareholders.”

“Nonetheless, the defendants have taken into account the expense, uncertainty and risks inherent in any litigation, especially in complex cases like the derivative action.”

The settlement is the latest involving the bank since its fraudulent customer-account scandal surfaced in September 2016.

On Sept. 1, 2017, the bank confirmed that at least 3.53 million checking and credit-card accounts were affected by the scandal.

The bank has said it cannot rule out the possibility that more than 38,000 unauthorized customer accounts were established in North Carolina and more than 23,000 were established in South Carolina.

Wells Fargo said in the March 1 filing that it may have to set aside as much as $2.7 billion in accruals related to potential losses from legal actions. That’s up $500 million from the $2.2 billion it estimated on Sept. 30.

The U.S. Securities and Exchange Commission, U.S. Justice Department, U.S. Labor Department and several state attorneys general and congressional committees have undertaken formal or informal inquiries, investigations or examinations arising from the scandal.

On Feb. 2, Wells Fargo released its latest mea culpa on the scandal, representing another attempt at “rebuilding trust with stakeholders and transforming the company.”

The bank’s Business Standards Report is titled “Learning from the past, transforming for the future.” It details steps the bank has taken “to address causes of past issues and provides updates on the company’s businesses, practices and progress on its six (rebuilding) goals.”

However, the 103-page report has served as much to galvanize the bank’s critics as to improve confidence in the bank, its management team and board of directors.

Get today’s top stories right in your inbox. Sign up for our daily morning newsletter.

rcraver@wsjournal.com 336-727-7376 @rcraverWSJ