JPMorgan Chase and Credit Suisse agreed on Friday to pay a combined $417 million to settle civil charges lodged by the Securities and Exchange Commission, which accused the firms of misleading investors about home mortgages that were pooled into securities and sold to Wall Street.

The settlements are the latest effort by regulators and prose­cutors to hold Wall Street accountable for misconduct stemming from the 2008 financial crisis. JPMorgan has faced especially intense scrutiny, mostly tied to Bear Stearns, a struggling firm it absorbed in the midst of the financial crisis at the request of federal regulators. JP.Morgan’s chief executive has said that the bank lost $5 billion to $10 billion related to Bear Stearns.

Under Friday’s settlement agreements, which await court approval, JPMorgan would pay $297 million and Credit Suisse would pay $120 million, all of which would be distributed to harmed investors. Neither firm admitted or denied wrongdoing, and both said they were pleased to put the matter behind them.

The settlement revived debate on whether JPMorgan, the nation’s largest bank, should be hit with enforcement actions tied to a firm it was asked to take on — an issue Rep. Barney Frank (D-Mass.) recently said falls into the “no good deed goes unpunished” category.

In its complaint, the SEC alleged that Bear Stearns unfairly profited from a practice involving delinquent loans that were packaged into mortgage securities and sold to trusts. The banks that originated those loans were required to buy them back if the loans defaulted within the first three months. When things were working as they should, Bear Stearns would get the money from the banks, put it in the trust and take out the faulty loans.

But from about 2005 through 2007, as the housing market collapsed, Bear Stearns began negotiating discount cash settlements with the loan originators, and in many instances it did not turn over the money to the trusts, according to the SEC complaint.

Robert Khuzami, head of the SEC’s enforcement division, said the fact that these activitites took place prior to JPMorgan’s takeover of Bear Stearns was a “relevant factor” in deciding the extent of the sanctions. But “it certainly would not be a right result if JPMorgan would be able to retain the ill-gotten gains,” Khuzami said.

Credit Suisse engaged in a similar practice from 2005 through 2012, the SEC said.

The government also accused JPMorgan of taking part in an illegal scheme that had nothing to do with Bear Stearns. The SEC alleged that JPMortgan and Credit Suisse misrepresented the quality of their loans. When JPMorgan issued about $1.8 billion of securities involving 9,600 subprime loans in December 2006, it told investors that four of those loans were a month or two past-due. In fact, 620 of them were delinquent, Khuzami said.

Credit Suisse told investors it would repurchase or substitute loans that missed a payment by a certain date, but kept “secretly extending the date,” and the poor-quality loans remained in the trust, Khuzami said.

The SEC has brought similar cases against other Wall Street firms for the packaging and selling of subprime mortgages that led to billions of dollars in losses for investors.

Just last month, New York Attorney General Eric Schneiderman filed a civil lawsuit against JPMorgan, alleging Bear Stearns engaged in widespread fraud in the sale of mortgage-backed securities in 2006 and 2007. The allegations in that case overlap with some made in the SEC complaint, but the New York case is ongoing, Khuzami said.

It’s the New York case that prompted Frank, who was chairman of the House Financial Services Committee during the Bear Stearns take over, to speak up on JPMorgan’s behalf. Federal officials believed the failure of Bear Stearns would have terrible consequences and urged JPMorgan to “do a good deed” by absorbing it, Frank said in a statement last month.

The remedy should be to pursue individuals involved in the illegal schemes rather than the institutions for which they worked, Frank said about Schneiderman’s case.