Diamond Foods will pay $5 million to settle charges by the Securities and Exchange Commission for its role in an accounting scheme.

The SEC said Thursday that it charged the San Francisco-based snack maker and two of its former executives for their roles in the falsifying walnut costs in order to boost earnings.

Diamond did not immediately respond to a request for comment.

The SEC said it has reached a settlement with the company and former CEO Michael Mendes. The SEC argues Mendes should have known the reported costs were incorrect at the time he certified the financial statements. Mendes has agreed to pay $125,000 to settle charges against him without admitting or denying allegations. Mendes has already returned or forfeited $4 million in pay received during the period of fraudulent reporting.

Mendes’ attorney Sarah Brody said in a statement that Mendes is happy to have resolved the matter.

But the SEC said that its litigation continues against Diamond’s former chief financial officer, Steven Neil.

The SEC said Neil directed the effort to underreport money paid to walnut growers by pushing the recording of payments into later fiscal periods. Manipulating these costs made the company’s earnings appear better than they were for 2010 and 2011. Neil also personally benefited by getting bonuses and other pay based on the company’s performance during this time.

The SEC says Neil faced pressure to meet or exceed the earnings estimates of Wall Street stock analysts and opted to create a fraudulent system in which the company’s results appeared to beat market forecasts. The SEC also says Neil misled independent auditors by giving false and incomplete information.

Diamond later restated its results to reflect the true costs after an internal investigation found that it had improperly accounted for the payments. The restatements effectively wiped $56.5 million in profit from its books for those two years.

The company suffered mightily from the fallout. Its stock price sank and it lost its bid to buy the Pringles brand from Procter & Gamble Co. in what would have been its biggest acquisition ever. It eventually replaced its CEO and chief financial officer over the issue.

Shares of Diamond sank from all-time trading highs above $96 in September of 2011 to below $13 the following year as a result of the tumult.