ALBANY, N.Y. (AP) — The financial services firm UBS has agreed to pay $230 million to New York state in a legal settlement stemming from the firm's handling of mortgage-based securities in the lead up to the 2008 financial crisis.

State Attorney General Eric Schneiderman announced the settlement Wednesday.

As part of the deal, UBS will pay $41 million to the state and another $189 million for community efforts to expand affordable housing and improve blighted properties.

Schneiderman's office says UBS sold mortgage-backed securities to investors based on incorrect statements. The Democratic prosecutor says in many cases the mortgages didn't comply with underwriting rules. Authorities say the actions harmed "countless" homeowners and investors.

A message left with the New York City-based company wasn't immediately returned.

More From WIBX 950