JPMorgan Chase & Co. and Credit Suisse Group AG have agreed to pay $416.9 million to settle Securities and Exchange Commission (SEC) allegations that the banks misled investors about the quality of their mortgage-backed securities.

According to the agency, both banks neglected to disclose the defective nature of the mortgages they were pooling into securities and selling. In one instance, the government says, JPMorgan told investors that only four of the loans underlying one $1.8 billion block of securities were delinquent, when the real number was 620.

Investigators also allege that both banks earned millions of dollars by falsely telling investors that they would repurchase or substitute good-quality loans for defective mortgages. Instead, regulators say, the banks kept the original, faulty mortgages in loan packages that they sold to customers.

As part of the multimillion-dollar deal, JP Morgan will pay $296.9 million and Credit Suisse will pay $120 million, with all money going to harmed investors. Neither of the banks admitted wrongdoing as part of the settlement.

Last month, Congressman Barney Frank defended JPMorgan against a separate complaint filed by New York Attorney General Eric Schneiderman, pointing out many of the complaints against the bank stemmed from wrongdoing at Bear Stearns, which JPMorgan acquired in 2008 at the behest of the federal government. “The decision now to prosecute J.P. Morgan Chase because of activities undertaken by Bear Stearns before the takeover unfortunately fits the description of allowing no good deed to go unpunished,” he said in a statement.