Canajohaire, NY (AP) – Ellie the potbellied pig snuggles up to Wyverne Flatt when he watches TV and sometimes rolls over to let him pet her belly. The 110-pound pig is “family,” Flatt says, an emotional support animal who helped him through a divorce and the death of his mother.

Officials in his upstate village of Canajoharie see it very differently. To them, the pig is a farm animal Flatt is harboring in the village illegally.

The case could soon be headed to a criminal trial. But it has already caught the attention of pig partisans who believe the animals should be respected more as companions instead of just a food source.

“I could never dream of giving away somebody who’s part of my family,” Flatt said recently as he patted the pig in his kitchen. “She’s very smart. She’s more intelligent than my dogs. I think she can kind of hone in on you when you’re feeling bad because she’ll want to come in and snuggle with you.”

Ellie is a knee-high Vietnamese potbellied pig with a black coat and hooves that clack on the floor as she walks from her kitchen food dish. Flatt was living in South Carolina when he got the pig in 2018, when she was “about as big as a shoe.”

She came north with Flatt in 2019 when he moved to Canajoharie, a modest village on the Mohawk River dominated by the husk of the old Beech-Nut food plant.

Flatt, 54, bought a fixer-upper near the business center of the village with plans to remodel it and maybe open restaurant on part of the ground floor. He also has two dogs and two cats.

A village code officer told Flatt he was housing Ellie illegally in October 2019 during a visit for a building permit request. When the village noticed Ellie was still there six months later, Flatt was formally notified he was violating the local code barring farm animals in the village. Violation of a zoning code is a misdemeanor under state law, according to court filings.

Flatt says the village is picking on his pig, which he says is clean and smart. Several of his neighbors have signed affidavits saying they like Ellie.

An attorney for the village wrote in a court filing that the pig is a potential public health hazard. She argued that if “every citizen were to openly scoff at the Village zoning codes … we would live in a lawless society.”

Ellie’s fate could hinge on federal housing guidance that says municipalities should provide a “reasonable accommodation” when a person can demonstrate an animal provides emotional support for a disability-related need. Flatt’s attorney argues that his client meets that test, saying that Ellie allowed Flatt to get off his medication and cope with his anxiety.

The village has argued in court filings it is willing to make reasonable accommodations, but that Flatt never met the standard.

“Defendant provided no legitimate proof that he is a person under disability, and no proof that his disability was remedied by having an emotional support animal, nor that the particular animal, a pig, was the only suitable remedy for his condition,” attorney Kirsten Dunn wrote in a filing last year.

A trial was scheduled to start March 22, but has been delayed. If found guilty, Flatt could face jail time or have the pig taken from him, according to his attorney.