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.