San Diego Mayor Bob Filner, facing a sexual harassment lawsuit and a string of allegations of inappropriate behavior toward women, said on Friday he would resign as the head of California's second-largest city.

A visibly emotional Filner addressed the San Diego City Council after members emerged from a closed meeting where they voted 7-0 to accept a settlement that requires him to step down, effective August 30, in exchange for the city joining in his legal defense in the lawsuit.

Filner, a 70-year-old Democratic former congressman elected San Diego mayor last year, had faced mounting pressure to step down after acknowledging behavior toward women that he said was unsuitable.

While Filner pledged to resign, his speech to a room full of reporters, accompanied by occasional cheers from supporters, was also defiant at times as he described being forced out of office.

"Certainly it was never my intention to be a mayor who went out like this," Filner said, before making an apparent reference to his 1960s work with civil rights group the Freedom Riders.

"You know I started my political career facing lynch mobs, and I think we have just faced one here in San Diego," he said. "In a lynch mob mentality, rumors become allegations, allegations become facts, facts become evidence of sexual harassment which have led to demands for my resignation and recall."

Filner's former press secretary, Irene McCormack Jackson, sued him in July, accusing him of sexually harassing her. Since then 17 more women have come forward to say he groped them or made other unwanted advances.

Jackson's lawsuit is at the center of the settlement between Filner and the city, which sued him last month seeking to hold him responsible for any damages arising from the lawsuit.

As part of the deal, the city will join in his legal defense, according to an outline of the arrangement from the City Attorney's office which will be responsible for representing the mayor.

The city could also underwrite up to $98,000 in attorney fees for Filner's private legal defense, the document said, and while the city would pay for some forms of damages that may arise, it would not cover punitive damages.

'No intention to be offensive'

During his speech, Filner, the first Democrat elected mayor of San Diego in two decades, also acknowledged that he had offended women.

"I had no intention to be offensive, to violate your personal or emotional space," he said.

In a statement, Allred noted that Filner in his speech had taken credit for protecting seals on San Diego beaches. "Unfortunately, he failed to give as much protection to the women who came into contact with him as he gave to the seals," she said.

Jackson, in her own written statement, said Filner "will not be missed."

Jessica Levinson, an associate clinical professor at Loyola Law School in Los Angeles, said Filner's only bargaining chip in discussions with the city had been his threat to remain in office.

"It sounds like it's an actual compromise, both sides get something," she said. "Ultimately what San Diego needs is for Filner to step down and for them to have a functioning mayor who's allowed in City Hall, and that the city doesn't fear that if he's allowed around women something bad is going to happen."

Under the city charter, City Council President Todd Gloria will assume the role of mayor until a special election is held within 90 days of the effective date of Filner's resignation.

If no single candidate in the special election wins a simple majority, then a runoff election would be held between the top two vote-getters within 49 more days.

The scandal will not hurt the chances of future Democratic candidates, said Steven Erie, a political science professor at the University of California at San Diego.

"I don't think it's damaged the Democratic brand for the simple reason that almost every major Democratic politician demanded Filner resign within about a week or so" of the scandal erupting, Erie said.

Haaretz.com, the online edition of Haaretz Newspaper in Israel, and analysis from Israel and the Middle East. Haaretz.com provides extensive and in-depth coverage of Israel, the Jewish World and the Middle East, including defense, diplomacy, the Arab-Israeli conflict, the peace process, Israeli politics, Jerusalem affairs, international relations, Iran, Iraq, Syria, Lebanon, the Palestinian Authority, the West Bank and the Gaza Strip, the Israeli business world and Jewish life in Israel and the Diaspora.