After the news of an undercover sting nabbing a mother for selling ceviche through a Facebook group went viral, the San Joaquin County, Calif., prosecutor’s office defended the charges against the woman, saying the case has been misunderstood and misrepresented.

Six members of the Facebook community food-sharing forum, 209 Food Spot, were charged with misdemeanors of operating a food facility and engaging in business without a permit.

One of those members, a single mother named Mariza Ruelas, refused to accept a plea deal and called the investigation a “waste of time and resources and taxpayers’ money,” in a complaint and in interviews that attracted widespread publicity across the nation.

In a news conference Wednesday, Robert Himelblau, supervising deputy district attorney for the county, responded to her, saying the investigation was “just not a waste of resources.”

“This was not a difficult investigation,” Himelblau said. “This was just right in front of us. It would be negligent for our office to ignore it,” adding that the office “did not send anybody out there to go hunt people down.”

The county began investigating 209 Food Spot in 2014 after someone reported becoming ill from food purchased through the group, the Los Angeles Times reported.

The case was handled through a unit dedicated to address “quality of life” issues such as insurance fraud and corporate oil leaks, in addition to food safety, Himelblau said in the news conference. Food-borne illnesses can be serious and even fatal, the District Attorney’s Office wrote in a news release.

The Centers for Disease Control and Prevention reported that 48 million people get sick, 128,000 are hospitalized, and 3,000 die from food-borne infection and illness in the U.S. each year. The California Homemade Food Act allows for small batches of some food, such as certain baked goods, to be prepared in homes and sold. But sales of food that requires refrigeration, such as meat, are forbidden.

“We are not trying to prevent people from cooking or sharing or doing potlucks,” Himelblau said. “We’re not saying that this is wrong, or you’re a wrong, bad person. We’re saying please stop this, you’re going to hurt somebody.”

In addition, food facilities not subject to permits and inspection create “unfair competition for legitimate, law abiding businesses,” the office wrote in the release.

If someone gets sick after a potluck at a friend’s house, or after eating free cookies in the office, the authorities won’t get involved, Himelblau said. But the food sold by the Facebook group members charged in the case represented a “for-profit business.”

“When money becomes involved and there’s a business, there’s a different set of rules,” he said.

Authorities mailed letters to members of the Facebook group they found advertising their meals online — including Ruelas — telling them to stop, the Los Angeles Times reported. But when Ruelas and the five other defendants failed to comply, the case was transferred to the district attorney’s office, which launched the undercover sting.

“If one person gets salmonella or E. coli and they die, then we’d be the first person they’d contact to say, ‘Why didn’t we do anything about this?’ ” Sherri Adams, chief deputy district attorney, told the Los Angeles Times.

“That’s our main objective — people who operate these types of businesses out of their home; there’s no oversight. They could be doing it in their dirty garage, in their kitchen with no sanitation.”

The five other members accepted a plea deal of one year of probation, a $235 fine and 40 hours of community service. Ruelas complained that she was offered a deal with 80 hours of community service and three years of probation, in addition to the $235 fine. She refused to accept the plea deal, and is set to go to trial in early December.

But Sherri Adams, the county’s chief deputy district attorney, told the Los Angeles Times that the woman was offered a stiffer plea agreement because she continued to advertise her meals online even after she was charged.

In an interview with The Post on Sunday, Ruelas expressed her and her children’s fears that she could spend up to a year in jail if convicted.

But, Adams told the Los Angeles Times, that would “never happen.” She said if Ruelas is convicted, she would probably get “no more than 10 days in county jail” for her crime.

“Her offer was community service. She’s making more of this than it is,” Adams told the Los Angeles Times. “It’s not the big, bad DA’s office trying to take this woman down.”

More from Morning Mix