Story highlights Filner says he was forced out due to a "coup" based on "rumor and innuendo"

His remarks left people inside City Hall stunned, a source says

Council president says the deal " allows our city to begin to heal"

18 women have publicly accused Filner of sexual harassment; 1 has sued

San Diego Mayor Bob Filner is resigning in the face of a torrent of sexual harassment claims -- though he's not going out quietly.

City Attorney Jan Goldsmith announced around 3:45 p.m. (6:45 p.m. ET) that the City Council, during a closed-door session, had accepted the terms of an agreement with Filner that was reached after three days of mediation talks.

Filner submitted a "signed resignation" that "the city has accepted" in a 7-0 vote by council members, Goldsmith said. That resignation will take effect at 5 p.m. Friday, August 30.

After that vote, Filner spoke at the City Council meeting -- his first extensive public comments in weeks -- and began by offering a "deep apology ... to all the citizens."

"The city should not have been put through this," the 70-year-old mayor said. "And my own personal failures were responsible."

JUST WATCHED Accuser: Filner grabbed me in this photo Replay More Videos ... MUST WATCH Accuser: Filner grabbed me in this photo 02:27

Photos: Photos: San Diego mayor's accusers Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Businesswoman Dianne York told CNN that San Diego Mayor Bob Filner put his hands on her buttocks during this photo op after a meeting three months ago. York said there were witnesses. She said both her advisers and Filner's were in the room at the time. Click through the gallery of other women who have come forward in the case. Hide Caption 1 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Caryl Iseman , a San Diego real estate agent, attended an anti-Filner rally in August. She told CNN iReporter Chris Morrow that at a fundraiser 25 years ago, after photos had been taken, Filner "decided he could reach around and grab my breast." Iseman indicated it was the first time she had spoken publicly about the alleged incident. "The sheriff's department knows about it. I have not yet come forward yet with it ... but if it's needed to establish the timeline of how long this guy has been doing this, I will." Hide Caption 2 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Peggy Shannon, a 67-year-old great-grandmother who works at the Senior Citizens Service Desk in San Diego City Hall, faced "continuous inappropriate sexual advances by Filner while trying to do her job," according to the office of her attorney, Gloria Allred. Hide Caption 3 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Kathryn Vaughn, a San Diego attorney, told CNN affiliate KFMB that after her husband walked away at a public event 10 years ago, Filner "made an inappropriate movement on my body." Hide Caption 4 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Eldonna Fernandez says Filner left her a flirtatious e-mail after they met at a Healing and Hiring Fair held by the National Women's Veterans Association of America in 2012. "Hi, it's your newly favorite congressman, Bob Filner. You know, the one who fell in love with you at your last speech," Filner said in the voicemail. Filner, 70, has been dogged for weeks by sexual harassment allegations. He has refused to resign. Hide Caption 5 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Army veteran Gerri Tindley says Filner got too close to her at a National Women's Veterans Association of America event where she gave a speech about being raped, which she said happened during her eight years of service. Tindley said she felt uncomfortable as Filner moved closer and closer -- so close, she said, that she nearly fell off the couch trying to move away from him. Hide Caption 6 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Michelle Tyler, center, has accused Filner of unwanted sexual advances . During a news conference, Tyler said that during a visit to his office in June, Filner rubbed her arm and asked for dinner dates in exchange for his helping Katherine Ragazzino, right, a brain-injured Iraq war veteran. Hide Caption 7 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Renee Estill-Sombright told CNN affiliate KGTV that the mayor called her "beautiful" at a church breakfast in June, said he couldn't take his eyes off her, asked whether she was married and then said he'd like to take her out some time. Hide Caption 8 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Emily Gilbert accused Filner of sexual harassment on Friday, August 2. She told CNN she was hired to sing at a fundraising event in December and the mayor grabbed her, slid his hand down the small of her back and gave her "tush a pat." He then asked her: "Oh, Marilyn, can I get your card?" she recalled. Hide Caption 9 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Filner's former spokeswoman, Irene McCormack Jackson, has also accused him of sexual harassment and filed a suit against him. She said Filner subjected her and other women to "crude and disgusting" comments and inappropriate touching. She resigned as Filner's communications director in June after, she said, she decided the mayor would not change his behavior. Hide Caption 10 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Nonprofit founder Morgan Rose said she met Filner in 2009 when she was lobbying for her organization, which works with military and other families hurt by domestic violence. She says he looked her up and down, stared into her eyes and said, "Your eyes have bewitched me." He then moved to her side of the booth, sat beside her, pinned her to the wall, and put his arm around her, Rose alleged. Hide Caption 11 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Political consultant Laura Fink has accused the mayor of patting her "posterior" at a fundraising event in 2005. At the time, Fink was working as the deputy manager of Filner's congressional campaign. She said she thinks Filner should resign. Hide Caption 12 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Sharon Bernie-Cloward, president of the San Diego Port Tenants Association, claims that when Filner was running for mayor in 2012, he approached her at a political event. "He touched me, actually groped me on my backside inappropriately," she told KPBS. "I was left there startled and fearful. In fact, I actually had someone walk me to my car that night." Hide Caption 13 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Patti Roscoe, a prominent businesswoman in San Diego's tourism and hospitality industry, told KPBS that on numerous occasions, Filner "put me in what I guess now is the famous headlock." She told the station: "I felt fearful, even as well as I knew him, because it was an invasion into my space. And he would come in and try to kiss me on the lips, and I'd have to squirm to get away." Hide Caption 14 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Veronica "Ronne" Froman, a retired Navy rear admiral and San Diego's former chief operating officer, told KPBS that she and Filner, then a congressman, met a few years ago at his office after everyone had left. "He stopped me and he got very close to me. And he ran his finger up my cheek like this, and he whispered to me, 'Do you have a man in your life?' " she said. Hide Caption 15 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Joyce Gattas, a dean at San Diego State University, told KPBS that she had several "interactions" with Filner "where he's held me too tight, a kiss on the cheek which is inappropriate, hands on the knee that last too long." Hide Caption 16 of 17 Photos: Photos: San Diego mayor's accusers San Diego mayor's accusers – Lisa Curtin, the director of government and military education at San Diego City College, told KPBS that Filner grabbed her hand, fingered her wedding ring and asked if it was real. She also said he tried to kiss her; she moved her head and felt his tongue on her cheek. Hide Caption 17 of 17

JUST WATCHED San Diego mayor supporters speak out Replay More Videos ... MUST WATCH San Diego mayor supporters speak out 04:34

A short time later, though, Filner went on the defensive. While admitting that his behavior toward women was inappropriate at times, he insisted that he "never sexually harassed anyone."

In the process of "trying to establish personal relationships," the mayor explained, "the combination of awkwardness and hubris, I think, led to behavior that many found offensive." He added, "Not one allegation ... has ever been independently verified or proven in court."

"But the hysteria that has been created ... is the hysteria of a lynch mob," Filner said, criticizing an environment in which "rumors become allegations, allegations become facts, facts become evidence of sexual harassment which have led to demands for my resignation and recall."

Blasting politicians and members of the media who "unleashed a monster," the mayor said, "The hysteria ended up playing into the hands of those who wanted a political coup -- the removal of a democratically elected mayor purely by rumor and innuendo."

"They found the weapons they needed in my own failures as a human being," Filner said of "well-organized interests" opposed to him. "But they found with those weapons and they used them, in a bloody and vicious way."

The outgoing mayor's remarks -- going from a contrite apology to a withering attack -- left many watching from inside City Hall stunned, according to a source who was there. The comment about his being the victim of a "coup" especially caught people off guard.

"We are shocked that he would go there," said the source inside City Hall.

This defiant stance notwithstanding, it doesn't change the fact that Filner's term as mayor ends -- according to a deal he agreed to -- next week.

And when it does, City Council President Todd Gloria will step in on an interim basis. Gloria said Friday afternoon, after the council session, that he'll soon begin work on setting up a special election.

Speaking shortly after Filner, Gloria -- who, along with the other eight council members, had demanded Filner's resignation -- said that he believes the "settlement represents an end to our civil nightmare, and it allows our city to begin to heal."

"San Diego is back," the incoming interim mayor said later. "We are America's greatest city, and we always will be."

The agreement signed off on Friday does not affect a lawsuit brought against Filner by Irene McCormack Jackson, the mayor's former communications chief, according to Goldsmith.

Jackson left her job when she sued the mayor in July -- saying he had subjected women to "crude and disgusting" comments and inappropriate touching -- but remains a municipal employee, Goldsmith noted. He said Friday that the city will continue to engage in mediation talks with Jackson and her lawyer, Gloria Allred.

Under the mediation agreement, San Diego will dismiss its cross-complaint against Filner in relation to that lawsuit, the city attorney said.

Goldsmith also said that, for any claims brought against San Diego and Filner for his alleged conduct while mayor, "the city will provide a joint legal defense through the city attorney's office for the city and Mr. Filner."

Friday's announcement marks the latest milestone in a saga that has gripped San Diego for seven weeks, when the first in what would be 18 women came forward publicly to accuse Filner -- during his time as congressman and, since 2012, as mayor -- of inappropriate behavior.

Numerous public officials, including all nine city council members and the state's two U.S. Senators, urged Filner to step down. So, too, did a majority of locals, according to polls.

Some of them voiced that view to city council members Friday, before they convened in private session to make their decision on the agreement.

Other speakers also rose to support Filner.

Scott Andrews claimed "everything but due process has occurred," while one woman called what's happening "a circus to get a good man out of office."

A few offered sympathy for the council members, given what they and other municipal leaders have dealt with in recent weeks and the decision that lay ahead.

"It is really about the city that we all love," said Laurie Black, a longtime civic leader. "And make your decision with the intentions of loving your city."

Even once Filner leaves office, the city could bear the repercussions of his alleged behavior.

As Goldsmith noted, the city can be held liable for the actions of its employees -- including its past and present mayor.

Filner, himself, is hardly out of the woods. While he now only faces one lawsuit, others could follow.

Plus, there's the chance that the congressman-turned-mayor could be prosecuted by local, state or federal authorities.

Speaking to that point after news of the resignation became official, California Attorney General's office spokesman Nick Pacilio said, "We can confirm a criminal investigation is underway."