SAN FRANCISCO — Diamond Foods has agreed to pay $5 million to settle civil fraud charges filed by the U.S. Securities and Exchange Commission over the company’s delayed accounting of payments to walnut growers.

The SEC announced charges on Thursday against Diamond, alleging that the nut and snack maker fraudulently accounted for payments to the growers in order to inflate its earnings for 2010 and 2011. The San Francisco–based company’s former CEO, Michael Mendes, and former CFO, Steven Neil, were also charged for their roles in the scandal.