ALBANY, N.Y. (AP) — The Royal Bank of Scotland agreed to pay $500 million to New York for using deceptive practices while marketing and selling mortgage-backed securities before the 2008 financial crisis, under a settlement announced on Tuesday.

New York Attorney General Eric Schneiderman said the settlement includes $100 million in cash to the state and $400 million worth of consumer relief for New York homeowners and communities.

As part of the agreement, RBS admitted it sold investors residential mortgage-backed securities that failed to comply with underwriting guidelines. Schneiderman said the bank's actions harmed "countless New York homeowners and investors" by contributing to the crash in home values.

The British taxpayer-owned bank announced last month its 2018 earnings could be hit by a pending multibillion-dollar settlement with the U.S. Department of Justice over its pre-financial crisis mortgage-backed securities.

Under the settlement, RBS will conduct community-level remediation including funding construction of more affordable housing, helping communities transform code enforcement systems and buying distressed properties to prevent them from being bought up by predatory investors.

"Today's settlement is another important step in our comprehensive effort to help New Yorkers rebuild their lives and communities," Schneiderman said.

The size of the settlement with the Justice Department was not immediately determined. The timing of it is out of the bank's control, RBS said while releasing its 2017 earnings report on Feb. 23.

The bank in July reached a $5.5 billion settlement in the U.S. with the Federal Housing Finance Agency over the mis-selling of residential mortgage-backed securities.

The New York settlement finalized Tuesday is separate from the settlements with the U.S. government, Schneiderman's office said.

Since the National Mortgage Settlement was announced by former President Barack Obama's administration in early 2012, the U.S. has received $5.8 billion from six of the largest mortgage servicers, with the New York attorney general securing $3.7 billion of the total, Schneiderman said.

More From WIBX 950