SAN DIEGO (AP) — The resignation speech given by San Diego Mayor Bob Filner reflected the same fiery, defiant tone that launched the political career of the former congressman and 1960s civil rights activist.

But Friday, Filner was giving his response after agreeing to step down as leader of the nation’s eighth-largest city amid a flurry of sexual harassment allegations.

“Obviously this is the toughest decision of my life. You all know me to be a fighter,” he said. “Unfortunately, on my own — and you all helped cut off any support for that — I can’t afford to continue this battle even though I know, if given due process, I would be vindicated.”

Filner apologized to the city and his accusers but also said his demise as San Diego’s first Democratic mayor in decades was the result of “lynch mob mentality” and continued to deny his actions amounted to harassment.

Filner spoke after the City Council voted 7-0 on a deal that ended a political stalemate after 17 women publicly accused him of acting inappropriately from patting bottom to forcible kissing.

The agreement stipulated that Filner leave office by Aug. 30 in return for the city paying legal expenses related to a sexual harassment lawsuit brought by his former aide.

Filner blamed his downfall on his own shortcomings but also said those failures were used as “ammo” to stop a leader willing to shake up the city’s power base, such as hoteliers and developers.

Filner evoked memories of his young adulthood, when he joined the Freedom Riders in their campaign against a segregated South and spent two months in a Mississippi jail for inciting a riot after he and others confronted an angry mob at a bus station.

“You know I started my career facing lynch mobs, and I think we have just faced one here in San Diego, and you’re going to have deal with that,” he said.

He said not one allegation has been proven independently or by a court, adding “I have never sexually harassed anyone.”

Much of Filner’s 15 minutes in the chambers sounded like a campaign stump speech. He trumpeted a five-year labor agreement with city unions, efforts to install solar panels on city buildings and clean up bird droppings at La Jolla’s postcard beaches. He urged his successor to pursue a laundry list of initiatives from addressing climate change to bringing the Olympic Games to the region.

Filner had for weeks resisted calls to resign, and underwent two weeks of behavioral therapy before returning to work this week.

But his support diminished as more women — including a university dean and a retired Navy admiral — came forward and told stories of Filner touching, making lewd comments and even placing them in headlocks.

Peggy Shannon — a great grandmother who said Filner would ask for dates and once took her hands and told her he could last eight hours at night — found Filner’s speech “hurtful.”

“I know we’ve proven something — because he is no longer mayor,” she said. “So due process runs in different ways.”

Under the agreement, the city will pay Filner’s legal fees in a joint defense of the lawsuit filed by the mayor’s former communications director, Irene McCormack Jackson, and pay for any settlement costs assessed against the mayor except for punitive damages, said City Attorney Jan Goldsmith. The city would also pay up to $98,000 if Filner wants to hire his own attorney.

Goldsmith said the city was obligated to provide his legal defense no matter what.

McCormack, as she is known professionally, claimed the mayor 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.

She was the first one to publicly accuse the mayor.

“My thoughts are with the courageous women, who because they spoke out, galvanized the residents of this great city and its elected leaders to rise up against a serial sexual harasser and a gross abuser of power,” McCormack said. “Bye-bye, Bob. You will not be missed.”

Filner still faces a criminal investigation. Nicholas Pacilio, a spokesman for the California attorney general’s office, confirmed after the mayor announced his resignation that an investigation was underway but declined to elaborate.

The San Diego County Sheriff’s Department is fielding complaints of sexual misconduct by the mayor and delivering its findings to the attorney general’s office. San Diego County District Attorney Bonnie Dumanis, who lost to Filner in last year’s election, has recused herself.

When Filner’s resignation takes effect, Todd Gloria, the Democratic City Council president, becomes acting mayor until a special election is held within 90 days. Democrats enjoy a solid edge over Republicans in voter registration, but the GOP will capitalize on the Filner debacle to try to reclaim an office it has held for nearly all of the last four decades.