A former Victoria Police prosecutor has sworn at a police officer as he was being sentenced to jail for a string of family violence crimes.

Shaun Perry, aged 47, of Ararat, stared at his estranged wife and children as he learned he would spend more than two-and-a-half years behind bars for offences the magistrate described as a "nightmare".

Perry was told to "stop it" by a police officer who was sitting between himself and his family, but he told her to "get f***ed".

Perry pleaded guilty in the Ballarat Magistrates Court to 21 charges, which included spitting in his former partner's face, pulling her hair, and assaulting her with a weapon.

The magistrate, Bob Kumar, said it was a serious case of family violence.

"There is something very wrong," he said. "He's a police officer of 16 years, he should have known better."

Perry spent almost two decades in the police force where he became a prosecutor in the court system.

His lawyer presented a number of character references to the court, and argued the pressures of policing adversely affected his client.

"It's a tough gig and we all know that," he said.

The court heard Perry suffered from a serious mental health disorder.

"He took it out on his family … and will kick himself for it," his lawyer said.

But the comments angered Perry's estranged wife whose court application to read her victim impact statement aloud was met with scoffs from his supporters.

"I've been diagnosed with post-traumatic stress but I'm not beating my children up," she said.

She told the court the family had never received an apology.

"Not once has there been a hint of remorse," she said.

Perry's children sobbed as he was sentenced and one had to be led from the court briefly.

The magistrate said Perry created an unsafe home and had to be held accountable for his actions.

"You should have known better," Mr Kumar said. "A term of imprisonment has to be imposed because of the seriousness of the charges."

Mr Kumar took into account Perry's guilty plea, his remorse, and a decision not to contest a charge that would have put his wife and children through cross-examination.

He sentenced Perry to two years and seven months behind bars, and a two-year community correction order.

Outside court, a family member said no sentence would be sufficient.

"This family's been through 18 years of unmitigated terror," he said.