SAN DIEGO -- Former San Diego Mayor Bob Filner, driven from office by sexual harassment allegations, pleaded guilty on Tuesday to a felony and two misdemeanors for unwanted physical contact with three women at public events.

Filner entered the plea under an agreement that calls for three months of home confinement and three years of probation, the California attorney general's office said.

Filner was charged with felony false imprisonment and two counts of misdemeanor battery.

The felony involved a woman restrained against her will at a fundraiser. The misdemeanors involved a woman who was kissed without permission and a woman whose buttocks were grabbed.

The plea deal also requires mental health treatment.

The maximum possible sentence for the felony is three years in prison and one year for each misdemeanor. Sentencing was set for Dec. 9.

Filner, 71, resigned in late August, succumbing to intense pressure after at least 17 women brought lurid sexual harassment allegations against the former 10-term congressman. He was less than nine months into a four-year term and was San Diego's first Democratic mayor in 20 years.

San Diego County sheriff's investigators had been interviewing Filner's accusers and said they would deliver their findings to the attorney general's office for possible prosecution. The state attorney general's office confirmed in August that it launched a criminal investigation.

Filner's former communications director, Irene McCormack Jackson, was the first woman to go public with allegations against Filner and filed a lawsuit against the mayor and the city, claiming her ex-boss asked her to work without panties, demanded kisses, told her he wanted to see her naked and dragged her in a headlock while whispering in her ear.

All nine City Council members as well as fellow Democrats called upon Filner to resign. A recall effort also was launched as more allegations surfaced. But in a defiant farewell speech, Filner said he was the victim of a lynch mob and believed he would be vindicated if due process was allowed to run its course.