“In all my years in the business, I have never seen a more toxic product,” Mr. Mozilo wrote in an April 17, 2006, e-mail to Mr. Sambol, referring to loans that allowed borrowers with poor credit histories to buy homes without putting any money down.

Mr. Mozilo also warned his colleagues about the dangers of a popular type of adjustable-rate mortgage that let borrowers pay a fraction of the typical monthly charge. In an April 2006 e-mail, Mr. Mozilo wrote that he had “personally observed a serious lack of compliance within our origination system as it relates to documentation and generally a deterioration in the quality of loans originated.”

In another April 2006 e-mail, Mr. Mozilo noted that his colleague Mr. Sambol considered the company’s subprime second mortgages “the ‘milk’ of the business. Frankly, I consider that product line to be the poison of ours,” he said.

Mr. Mozilo and his colleagues neither admitted nor denied the government’s charges. The payment by Mr. Mozilo will consist of $22.5 million in civil penalties and $45 million in disgorged stock profits. Mr. Sambol agreed to pay $520,000 in penalties and $5 million in disgorgement. Countrywide is paying for all of Mr. Sambol’s disgorged funds; Bank of America has been paying Mr. Mozilo’s legal fees, and the $20 million Countrywide is paying on his behalf applies to stock profits he was forced to give up.

James D. Cox, professor of corporate and securities law at Duke University, said the settlement was on the high end for an individual corporate officer. “We’re used to seeing $100 million settlements when it’s against Goldman Sachs or after-hours trading of mutual funds,” he said, “but we don’t usually see eight-figure settlements with individuals.”

The settlement was also good for the government, Mr. Cox said. “This is not a slam dunk; it’s a risky case and it’s got a lot of complexities to it.”

Robert Khuzami, director of enforcement at the S.E.C., said in a statement: “Mozilo’s record penalty is the fitting outcome for a corporate executive who deliberately disregarded his duties to investors by concealing what he saw from inside the executive suite  a looming disaster in which Countrywide was buckling under the weight of increasing risky mortgage underwriting, mounting defaults and delinquencies and a deteriorating business model.”