So for residents of San Diego, it seems the long municipal nightmare will soon be over:

San Diego Mayor Bob Filner has agreed to resign as part of a deal reached this week with city officials, NBC 7 News has learned.

Filner, spotted leaving City Hall with packing boxes Wednesday night, will formally vacate the office following a closed session of City Council Friday, according to several sources.

City officials announced just before 7 p.m. Wednesday a proposed solution had been reached in the scandal that has consumed the city of San Diego since it first broke July 10.

In the last six weeks, more than a dozen women have come forward with tales of alleged sexual harassment and unwanted sexual advances.

Filner has admitted to disrespecting and at times intimidating women, saying that he needed help. He announced he would enter a treatment program for an undisclosed disorder or illness.

Under investigation for alleged “pay to play” schemes with developers, Filner disappeared from public view for three weeks and surfaced Monday in time for a mediation session with city officials.

The silver lining of this whole mess will be another burst of realization that sexual harassment is not a thing of the past, and also that it has become perilous for those who treat it as a perk of high office or just of being The Boss. Filner’s own handling of the scandal will undoubtedly become a fresh cautionary tale in textbooks dealing with Damage Control.

Meanwhile, life goes on for San Diego:

Once Filner resigns, San Diego city government will enter a period of interim leadership. Council President Todd Gloria will take on the role of acting mayor under the city charter. There could be at least one primary special election within 60 to 90 days.

I doubt any aspirants to the job were exactly taken by surprise.

Our ideas can save democracy... But we need your help! Donate Now!

Ed Kilgore is a political columnist for New York and managing editor at the Democratic Strategist website. He was a contributing writer at the Washington Monthly from January 2012 until November 2015, and was the principal contributor to the Political Animal blog.