The Securities and Exchange Commission said the bank was also charged with violating custody rules designed to safeguard investor assets. The bank agreed to settle the case without admitting or denying the charges.

A spokeswoman for Morgan Stanley's wealth management unit said the company was pleased to have the matter resolved.

“All affected clients have been reimbursed and the firm has enhanced its policies and procedures, including discontinuing the use of certain legacy systems," company spokeswoman Christine Jockle said in a statement.

The SEC said that the billing errors at Morgan Stanley affected more than 149,000 clients. Between 2002 and 2016, the bank received more than $16 million in excess fees as a result of the errors.

In addition, the SEC said that Morgan Stanley did not comply with custody rules, in which an independent accountant conducts an annual "surprise" exam to ensure asset managers are keeping their clients' money safe.

For two consecutive years, the SEC said, Morgan Stanley did not provide the accountant with a complete or accurate list of client funds and it failed to preserve client contracts.

This was the second time in less than a month that Morgan Stanley has faced SEC fines.

On Dec. 20, another unit of the bank paid $7.5 million to settle charges that it violated customer protection rules when it used trades involving customer cash to lower its borrowing costs.

(Reporting by Sarah N. Lynch; Editing by Jonathan Oatis)

By Sarah N. Lynch