Charles Schwab has agreed to pay $187 million to settle charges brought by the Securities and Exchange Commission, which accused the financial services firm of misleading investors with a recommendation to keep large sums of money in cash — ultimately dragging on their portfolio returns.

The regulator said on Monday that Schwab’s robo-adviser — an automated service that creates and manages investor portfolios — made false and misleading statements about its recommendations from March 2015 through November 2018. The firm did not charge an advisory fee for its service — and advertised it as such — but failed to disclose that its higher cash allocation would reduce investor returns by about the same amount as a separate advisory fee, the order said.

Schwab made money on the cash allocations — anywhere from 6% to 30% of an individual’s money. It collected revenue on the difference between the interest it paid to its robo-adviser customers and the interest it collected by lending that money out, according to the SEC.

“Schwab claimed that the amount of cash in its robo-adviser portfolios was decided by sophisticated economic algorithms meant to optimize its clients’ returns when in reality it was decided by how much money the company wanted to make,” Gurbir S. Grewal, director of the SEC’s enforcement division, said in a statement.

Most robo-advisers charge a low management fee to oversee portfolios, in addition to the underlying cost of the investments. But when Schwab introduced its service in 2015, it said it was not charging such a fee. At the time, Schwab was criticized for its decision to allocate a much larger portion of the portfolios to cash than many financial advisers would typically recommend.

Schwab agreed to resolve the charges on Monday but did not admit to or deny the SEC’s allegations. It also agreed to work with an independent consultant to review the company’s policies and procedures and ensure it was in compliance.

The $187 million will go to “harmed clients,” the SEC said. That includes a $135 million civil penalty and about $52 million in disgorgement, or profits that Schwab must return from the alleged activities, as well as interest.

In a statement, Schwab said the firm was “proud to have built a product that allows investors to elect not to pay an advisory fee in return for allowing the firm to hold a portion of proceeds in cash.” It added that it does “not hide the fact” that it generates revenue for its services, and the company believed cash is an important part of “any sound investment strategy through different market cycles.”