SAN DIEGO — San Diego Mayor Bob Filner will resign from office as part of a mediation deal reached in his sexual harassment lawsuit, sources familiar with the negotiations said Thursday. Filner’s decision to resign comes after three days of closed-door mediation and after six weeks of scandal in the city. At least 18 women have publicly accused Filner of sexual harassment, including one former aide who filed the lawsuit. In exchange for his resignation, the city will pay some, if not all, of Filner’s share of any damages awarded in the lawsuit, said the sources. The city council is set to vote on the settlement in a closed session Friday. Filner, a Democrat, was seen Wednesday night loading boxes into an SUV parked outside city hall and driven by a San Diego police officer, part of the mayor’s security detail, after saying farewell to his staff and cleaning out his office. For weeks, even with an avalanche of negative publicity, Filner had resisted calls that he resign. He apologized for misconduct toward women and entered two weeks of behavioral therapy. But nothing cooled the controversy. In response to efforts to remove him, Filner said in a statement: “Now is not the time to go backwards - back to the time middle-class jobs and neighborhood infrastructure were sacrificed to downtown special interests. We need to continue to move forward.” All nine council members and numerous other officials had called for Filner’s resignation.