David Martinez, a former candidate for a St. Paul, Minnesota, City Council seat, posted a topless photo of his wife on his campaign website. The ex-politician was sentenced to spend two years on probation for a count of non-consensual dissemination of private sexual images, local media reported Sunday.

The judge also ordered Martinez to get a mental health evaluation, stay away from drugs and alcohol, and not contact his spouse. Martinez posted the revenge porn on July 14, 2018 and during questioning at the time said his website was hacked. His wife filed an order of protection against him.

​After denying his involvement for months, Martinez pleaded guilty in March, following which his felony charge was downgraded to a gross misdemeanor — one count of nonconsensual dissemination of private sexual images.

Ramsey County District Judge Robert Awsumb said in court during the sentencing that if Martinez violates the orders against him then he could face up to a year in prison.

According to Fox News, Martinez was accused of domestic abuse during his 2018 campaign. After the nude photo of his wife surfaced, local politicians, including St. Paul Mayor Melvin Carter, called for him to drop out of the race.

“I know how terrifying it is to be threatened in the way Mrs. Martinez describes and my heart goes out to her and their children,” Ward 4 candidate Shirley Erstad said at the time. “As a woman and mother of three daughters, I am all too aware of the repercussions of sexual exploitation and violence against women and the consequences when good people stand by and say nothing. I support Mayor Carter’s position. Mr. Martinez’s actions against his family and the broader community are completely unacceptable and disqualify him from holding public office.”

Martinez was ejected and banned from Target Field — home of the Minnesota Twins baseball team. Later, he was arrested and banned from St. Paul public libraries.

Martinez went on to lose the city council race in a special election to Mitra Jalali Nelson in August 2018.​

Arrested
Here, a photo shows a handcuffed man at the police headquarters in Lille, northern France, Nov. 29, 2018. Philippe Huguen/AFP/Getty Images