Department of Correction officials threw out $40,000 worth of instant mashed potatoes this week after a food inspector found live insects in the food, a department spokesperson confirmed.

According to an incident report shared with Gothamist, the inspector found insects in 542 cases of instant mashed potatoes at the Rikers Island jail facility on Monday. The spokesperson said the cases of potato product had arrived in a bulk order, and that the vast majority was used without any issues.

But some detainee advocates say the contamination is part of a larger food safety problem.

Legal Aid Society attorney Veronica Vela said she’s glad the department caught the infestation before detainees got sick.

“If someone was sickened by tainted food there is no guarantee they would promptly receive needed medical attention,” she said, referring to claims that Rikers detainees are routinely deprived of basic medical care.

“The failures of Rikers management compound each other. An outbreak of foodborne illness in the jails could be catastrophic,” she said.

According to the Centers for Disease Control and Prevention, people who are incarcerated are at increased risk for foodborne disease outbreaks, with one study finding correctional inmates are 6.4 times more likely to suffer from a food-related illness than the general population.

The contaminated food was not an isolated incident for the jail, said Lucas Marquez, director of civil rights and law reform for Brooklyn Defender Services.

“We've had multiple clients report vermin in their food,” he added. “At least two separate instances in the past, say, several months in which a dead rodent was found on a tray of food.”

Loray Hodge said her son — who is currently detained at the OBCC facility on Rikers — told her there are “worms and bugs” in the food. She and other family members are currently sending him about $100 per week to spend at the commissary, she said.

Defense attorney Sarena Townsend, who previously led investigations for the city Department of Correction, said the spoiled food is one of a few recent examples of misspent money during a time of deep cuts to social services and training at the city jails.

“When you see there needs to be budget cuts across city agencies, including at the Department of Correction, but then you also see that they're throwing out $40,000 worth of food and spending $90,000 on sniper rifles… it just really underlines the point that this place is not being managed correctly,” she said.

The Department of Correction recently made its third purchase of sniper rifles and accessories in less than a year – this time buying ammunition, scopes and tripods at a cost of about $150,000, according to records obtained by Gothamist.

In 2015, a group of Rikers Island detainees sued the city alleging they were served a meal of meatloaf and cabbage they believed to be contaminated with blue-green rat poison, which sickened 19 people, Politico reported.

In 2003, a New York appeals court found that three of the biggest jails on Rikers Island had served vermin-contaminated food to detainees, the New York Post reported.

Clarification: This story has been updated to clarify that both Loray Hodge and other family members are sending money to her son at Rikers.