Former San Diego Mayor Bob Filner (D) pleaded guilty on Tuesday to false imprisonment and battery, after he resigned in disgrace earlier this year due to sexual harassment allegations.

As part of an agreement with prosecutors, the former Democratic congressman will serve three years probation, give up a portion of his federal pension and attend treatment. He will be restricted to his home for three months.

He is also restricted from ever serving in public office again.

If Filner fails to comply with the treatment, he could face up to six months in prison.

The charges are related to three unidentified victims. The false imprisonment charge is a felony while the two battery charges are misdemeanors.

“This conduct was not only criminal, it was also an extreme abuse of power,” California Attorney General Kamala Harris said.

Filner resigned in disgrace on Aug. 30 after more than a dozen women accused him of sexual harassment while he served as mayor. His resignation followed a City Council vote on an agreement for him to leave and mounting pressure from the Democratic Party to step aside.

Filner apologized for his behavior, but maintained his innocence against charges of sexual harassment.

During his resignation, he pointed out that none of the charges had been independently verified in court, and maintained that a “lynch mob mentality” by the public regarding charges of sexual harassment had given him no choice but to resign.

His resignation agreement did not block him from any criminal charges, but reports indicated that it would limit his exposure to lawsuits. As part of the agreement, the city of San Diego agreed to pay for his legal defense against any lawsuit, but not criminal charges.

--This report was updated at 1:52 p.m.