UBS AG agreed to pay $230 million to resolve a New York state probe into its marketing of residential mortgage-backed securities before the financial crisis, boosting the state’s recoveries in the investigation to almost $4 billion.

The settlement includes $189 million in consumer relief and $41 million in cash for the state, Attorney General Eric Schneiderman said Wednesday in a statement. He said the bank ignored the advice of its own diligence vendors in packaging and selling loans that didn’t conform to its underwriting guidelines.

Royal Bank of Scotland Group Plc agreed earlier this month to pay $500 million to settle a parallel investigation by Schneiderman, moving the government-owned lender a step closer to resolving a series of costly U.S. investigations.

JPMorgan Chase & Co. and Bank of America Corp. previously paid $1 billion and $800 million, respectively, to settle New York’s probes into sales of residential mortgage-backed securities. Citigroup Inc., Morgan Stanley and Goldman Sachs Group Inc. have also settled.

“New Yorkers are still recovering from the housing crash, as communities grapple with the effects of plummeting home values, vacant properties and an affordable housing crisis,” Schneiderman said.

Erica Chase, a UBS spokeswoman, didn’t immediately return an email seeking comment.

Copyright 2018 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.