San Diego Mayor Bob Filner speaks after resigning at a city council meeting Friday, Aug. 23, 2013, in San Diego. Filner agreed to resign on Aug. 30, bowing to enormous pressure after lurid sexual harassment allegations brought by at least 17 women eroded his support after just nine months on the job. San Diego Mayor Bob Filner speaks after agreeing to resign at a city council meeting Friday, Aug. 23, 2013, in San Diego. The San Diego city council voted Friday on the agreement between Filner and city negotiators that lead to his resignation following allegations of sexual harassment. San Diego Mayor Bob Filner walks away after agreeing to resign at a city council meeting Friday, Aug. 23, 2013, in San Diego. San Diego Mayor Bob Filner arrives to speak to the city council during a city council meeting Friday, Aug. 23, 2013, in San Diego. Filner agreed Friday to resign on Aug. 30, bowing to enormous pressure after lurid sexual harassment allegations brought by at least 17 women eroded his support after just nine months as leader of the U.S. border city. San Diego Mayor Bob Filner turns towards the public as he speaks during at a city council meeting Friday, Aug. 23, 2013, in San Diego. SAN DIEGO (AP) - Mayor Bob Filner agreed Friday to resign in return for the city's help defending him against claims he groped, kissed and made lewd comments to women, allegations that shook and embarrassed the city and turned the former 10-term congressman into a national punch line. Filner was regretful and defiant during a City Council meeting as he explained the "the toughest decision of my life." He apologized to his accusers but insisted he was innocent of sexual harassment and said he was the victim of a "lynch mob." "The city should not have to go through this, and my own personal failures were responsible and I apologize to the city," Filner said after the council voted 7-0 on a deal that ended a political stalemate after 17 women publicly accused him of harassment. "To all the women that I've offended, I had no intention to be offensive, to violate any physical or emotional space," he said. I was trying to establish personal relationships but the combination of awkwardness and hubris led to behavior that I think many found offensive. The city will pay Filner's legal fees in a joint defense of a lawsuit filed by the mayor's former communications director 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. Filner, backed by a sometimes boisterous crowd of supporters, challenged the City Council to pursue a laundry list of his policy initiatives, ranging from addressing climate change to bringing the Olympic Games to the region. He warned of dire consequences if his priorities are ignored by well-entrenched power brokers. "I am responsible for providing the ammunition," he said. I did that and I take full responsibility, but there are well-organized interests who have run this city for 50 years who pointed the gun, and the media and their political agents pulled the trigger. Filner choked up as he apologized to his former fiancee, Bronwyn Ingram, who ended the relationship just before the scandal erupted and called for him to resign. I love you very much. You came to love San Diego as much as I did and you did memorable things in the short time that you were first lady," he said. The 70-year-old Filner, a liberal Democrat, served 20 years in Congress before becoming mayor of the nation's eighth-largest city. He had previously insisted he still could be an effective mayor and underwent two weeks of behavioral therapy before returning to work this week. But his support diminished as more women - one of them a great-grandmother and another a retired Navy admiral - came forward. Some of Filner's closest political allies and all nine members of the council called on him to quit. On Friday, just before the council vote, the Democratic National Committee took the extraordinary step of passing a resolution demanding Filner leave. Dozens of people spoke for and against the mayor before the council convened behind closed doors to discuss terms negotiated between Filner and the city attorney. "Without the mayor's resignation, our city will continue to be paralyzed by this scandal, progress will be arrested and our focus will continue to be monopolized by this dark chapter in our history," said Laura Fink, a political consultant who accused Filner of patting her buttocks in 2005 when she was deputy campaign manager to the then-congressman. Still, many who came to the special meeting supported the embattled mayor, hailing his work on behalf of civil rights and struggling minority groups. When my children ask me, 'Where were you when the public lynching of Mayor Filner took place?' I will tell them I was not an accessory," said Enrique Morones, president of immigrant advocacy group Border Angels. Filner's biggest bargaining chip at the negotiating table was his refusal to resign. The deal does not include attorney Gloria Allred, who represents Filner's former communications director, Irene McCormack Jackson, in a lawsuit filed against Filner and the city. Allred had said earlier that the City Council should not support it if in exchange for his resignation the city is going to use taxpayer money to pay Filner's legal bills. "The mayor's resignation should not be bought at the expense of his victims," she said Thursday. It would be morally wrong and hypocritical for the city to align itself with the mayor by helping him pay his legal fees. McCormack, as she is known professionally, was the first woman to go public with allegations against Filner and her lawsuit is the only filed against the mayor and the city. McCormack 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. 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. San Diego is not new to political scandals - Mayor Dick Murphy resigned in 2005 amid a financial crisis and Mayor Roger Hedgecock stepped down in 1985 after a felony conviction for conspiracy in connection with illegal campaign contributions - but even so Democratic consultant Chris Crotty said this has reached a new level. 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. After taking office on Dec. 3, 2012, Filner struck a five-year labor agreement with city unions and opened a city of San Diego office in Tijuana to strengthen ties with the Mexican border city, However, he alienated many key players even before the allegations surfaced, including members of the City Council, the city attorney and hoteliers. Filner, who began his political career on the San Diego school board and later served on the City Council, is twice divorced. Ex-fiancee Ingram ended her marriage engagement days before the scandal broke and later said Filner sent sexually explicit text messages to other women and arranged dates in her presence. Associated Press writer Michael R. Blood contributed to this report from Los Angeles.