Bank of America Merrill Lynch agreed to a $42 million penalty with New York State to settle allegations of fraudulent electronic services practices conducted by the bank's investment arm, the office of state Attorney General Eric Schneiderman announced Friday.

According to the attorney general's office, BofAML entered into undisclosed agreements with so-called electronic liquidity providers over a five-year period, beginning in 2008, without the bank properly alerting investors to the practices. These providers included Citadel Securities, Knight Capital, D.E. Shaw, Two Sigma Securities, and Madoff Securities, according to Schneiderman's office.

Investors were led to believe that BofAML's electronic trading services were safer and more sophisticated than they really were, the attorney general said.

“Bank of America Merrill Lynch went to astonishing lengths to defraud its own institutional clients about who was seeing and filling their orders, who was trading in its dark pool, and the capabilities of its electronic trading services,” Schneiderman said in a statement. “As Wall Street firms offer increasingly complex electronic trading services, they cannot use new technology to exploit their clients in service of their business relationships with large industry players, like Bank of America Merrill Lynch did here.”

The attorney general's office said BofAML admitted it concealed from clients that millions of their equity securities orders were being routed to the electronic liquidity providers. Rather, clients were led to believe the investment bank was handling them in-house. BofAML went so far as to doctor clients' trade confirmation messages—or “masking,” as the bank's employees referred to it—as well as other reports for clients to help cover up the nature of the transactions.

Masking was applied to over 16 million client orders between 2008 and 2013, representing over 4 billion traded shares, Schneiderman's office said.

The office also said it found BofAML had inflated the amount of retail orders routed to and executed in its “Instinct X” dark pool, by as much as six times the actual volume, as well as overstated the robustness of its “Venue Analysis” trading product.

The announcement is just the latest in the office's ongoing efforts by the attorney general's investor protection bureau, armed with the state's powerful Martin Act. The office said as a result of its investigations regarding electronic trading at major Wall Street financial institutions in recent years, BofAML and three other firms, including Barclays and Credit Suisse, have now agreed to pay $125.5 million in penalties to the state for their wrongful conduct.

“I urge all members of the financial community to evaluate and if necessary reform your practices around electronic trading services, to ensure that you treat each and every client, big and small, ethically and loyally. For those financial institutions that refuse to do so, we will hold you accountable,” Schneiderman said.

A spokesman for BofAML did not respond to a request for comment.