By Suzanne Barlyn

(Reuters) - Bank of America Corp's Merrill Lynch brokerage unit will pay $415 million and admit to wrongdoing to settle charges that it misused customer cash, the top U.S. securities regulator said on Thursday.

The Securities and Exchange Commission, in announcing what it said is the largest customer protection settlement in the United States in the agency's history, said Merrill Lynch kept billions of dollars at its own disposal that should have been deposited into a reserve account that could help protect customers if the firm unexpectedly failed.

Merrill Lynch violated an SEC rule for protecting customers' assets by holding up to $58 billion a day in a clearing account, Andrew Ceresney, the SEC's enforcement director, said in a call with reporters.

The practice, which occurred between 2009 to 2015, freed up billions of dollars per week for Merrill, which financed the firm's trading activities for part of that time.

Firms typically park certain funds in clearing accounts temporarily before transferring them elsewhere. But a reserve account is for setting aside funds for a specific purpose, including the return of customers' funds if a firm unexpectedly fails.

If Merrill Lynch's business failed during those trades, customers would have been exposed to a massive shortfall in the reserve account, the SEC said.

“While no customers were harmed and no losses were incurred, our responsibility is to protect customer assets, and we have dedicated significant resources to reviewing and enhancing our processes," Merrill Lynch spokesman William Halldin said in a statement.

"The issues related to our procedures and controls have been corrected. We have cooperated fully with the SEC staff throughout this investigation,” Halldin said.

At issue is an industry rule requiring securities for which customers have fully paid to be held in accounts that are not subject to liens. The measure shields customers from claims by third parties should a firm collapse, the SEC said.

The clearing account in which Merrill held the customers' funds was subject to a general lien, Ceresney said. Some Merrill employees were aware of the lien as early as 2009, but the firm did not take steps to fix the issue until the SEC brought it to attention, Ceresney said.

The SEC is also suing Merrill's former head of regulatory reporting, William Tirrell, who held the position when Merrill was misusing customers' cash. Tirrell was responsible for determining how much in assets to reserve for customers' benefit if Merrill's business failed, the SEC said.

Tirrell failed to adequately monitor the trades and provide specific information to Merrill's regulators about the trades, the SEC said.

"While we are disappointed that the SEC filed this action, Mr. Tirrell looks forward to the opportunity to vindicate himself," said Steven Witzel, Tirrell's New York-based lawyer.

Merrill Lynch also violated an SEC rule by using language in severance agreements to stop employees from coming forward to the SEC with information, the SEC said. The company has since revised the agreements and launched a whistleblower training program for employees.

The case came to light after multiple former Bank of America executives reported the company's misconduct to the SEC, said Jordan Thomas, the whistleblowers' New York lawyer.

(Reporting by Suzanne Barlyn; Editing by Marguerita Choy and Leslie Adler)