In one of the largest cases of employee fraud against Cargill Inc., a former bookkeeper from upstate New York has been sentenced to five years in prison and ordered to pay $3.5 million in restitution.

Diane Backis, who had worked at Cargill's grain-shipping operations at the Port of Albany since 1986, pleaded guilty a year ago to skimming $3.1 million off grain sales and causing more than $25 million in additional losses to the Wayzata-based company. It was a scheme that went undetected for at least a decade.

Backis admitted to mail fraud and filing a false income-tax return over a plot in which she charged customers for animal feed at prices well below what her employer had paid and falsely recorded those sales at prevailing market prices. The entries made it look like the customers still owed money. In some cases, Backis directed customers to send payments directly to her, bypassing Cargill's corporate controls.

At a sentencing hearing Tuesday, U.S. District Judge Mae D'Agostino scolded the 51-year-old woman for the "insidious" scheme, calling Backis both "greedy" and "piggish," according to a release from the U.S. Attorney's Office in Albany, N.Y.

Cargill discovered the deception in 2016 while reviewing financial results for the facility in Albany, which operates one of the nation's largest grain elevators east of Mississippi and serves a five-state region.

The company worked with the Federal Bureau of Investigation, which conducted an undercover investigation. Cargill fired Backis on June 2, 2016.

The tax-fraud charge is related to Backis' 2015 individual tax return, on which she declared $61,208 in income, but omitted more than $450,000 she received that year by stealing Cargill customer payments, according to court records.

Claude Nebel, Cargill's vice president and chief security officer, wrote in an impact statement that Backis' action caused harm in ways beyond "tangible financial losses," including harm to its reputation and exposure to claims by third parties.

"As a result, the implications of this crime will continue far beyond today with both financial and character damage difficult to estimate at this time," he said.

Cargill, one of the nation's largest privately held companies, has made an insurance claim to recover the losses, but has not received any proceeds, according to an attorney representing the company.

In a statement, a Cargill spokeswoman said the company is "satisfied that the criminal-justice process has now come to an end."

"Cargill customers were not adversely affected by the fraudulent activity," April Nelson said in an e-mail. "We conducted a thorough investigation of Cargill's controls and trading systems and are confident this was an isolated incident."

But farmers in the agricultural community around Albany have complained to local reporters that Cargill isn't the only victim.

And some have contacted attorneys to consider future legal action.

"Neither the government nor Cargill have acknowledged the hardship this has created for farmers in this area," said Daniel Rubin, an attorney with Girvin and Ferlazzo, which has partnered with the larger firm of Cullenberg and Tensen, also in Albany, on a potential case that might center around unfair competition.

"That it has also suffered losses does not relieve Cargill of its responsibility to the hardworking farm families affected by its failure to uncover and put a stop to its employee's fraudulent acts for more than 10 years."