Morgan Stanley & Co. LLC has agreed to pay $150 million to settle a lawsuit brought by the state of California claiming the bank misled investors in the run-up to the mortgage crisis of the past decade.

Then-Attorney General Kamala Harris sued the bank in 2016 claiming Morgan Stanley and its affiliates downplayed the risk of mortgage-backed securities sold from 2003 to 2007 to investors including the California Public Employees’ Retirement System (CalPERS) and the California State Teachers Retirement System (CalSTRS). The Attorney General’s Office claimed the bank failed to disclose the quality of many home loans underlying the investments and, due to shortcomings in the bank’s due diligence, failed to remove poor quality loans from the investments.

“Morgan Stanley lied about the risk of its products and put profits over teachers and public employees who relied on its advice,” said Attorney General Xavier Becerra in a statement announcing the settlement Thursday. “Today’s settlement holds Morgan Stanley accountable for misleading Californians who were unfairly blindsided. Our office has recovered over $1 billion from cheaters on Wall Street since the financial crisis. Our work isn’t over.”

A spokesman for Morgan Stanley noted that the bank denied the allegations against it, and any liability as part of the settlement deal. He also noted that the settlement marked the end of the last pending enforcement action against Morgan Stanley related to the mortgage crisis.

The settlement notes that the $150 million amount constitutes restitution and should not be considered a fine or penalty. According to the Attorney General’s Office, CalPERS will recover $122 million as part of the deal and CalSTRS will recover $8 million. The remaining $20 million of the settlement funds is set to cover the costs of the investigation and lawsuit and to help fund future investigations and prosecutions.

The bank was represented by counsel at Davis Polk & Wardwell and Shearman & Sterling in the matter.