ALBANY – A longtime confidante to Assembly Speaker Sheldon Silver who has helped run damage control over some of the more embarrassing controversies in the Democratic legislative body for two decades is quitting amid allegations he did not investigate sexually harassment charges brought by a young female staff member against a Democratic lawmaker.

The resignation of William Collins, counsel to the Democratic majority, comes as Silver said he was only told last month about the inappropriate contact that occurred in 2009 between Manhattan Assemblyman Micha Kellner and one of his female staffers.

Collins, the top legal adviser to Silver on all internal matters within the Assembly, failed to investigate evidence brought to him in 2009 by a supervisor on Kellner’s staff that outlined sexually inappropriate comments the lawmaker wrote to a young, new member of his staff.

Kellner, according to the New York Times, which first reported the story late Tuesday night, apologized and called his actions “wrong” and “stupid.” Kellner, 34, who is bisexual, has since married a woman; he is running for a seat on the New York City Council.

The newest surfacing of inappropriate actions by a member of the State Legislature comes after an especially busy year of embarrassments, as seen by the resignations or arrests of lawmakers on everything from sexual harassment allegations to corruption charges. Two lawmakers, facing their own legal problems, went so far as to secretly record colleagues at the behest of prosecutors.

And officials revealed Tuesday there is now even a special line item in the Assembly budget for sexual harassment incidents. Officials said the Albany law firm of Roemer, Wallens, Gold and Mineaux has been retained by the Assembly ethics panel “to assist and conduct investigations that the committee deems appropriate.” The contract is for $14,000 through the end of the year, an amount that presumably could rise depending on any unforeseen additions to the contract’s caseload.

The state Republican Party on Wednesday wasted little time highlighting the latest scandal to be revealed in the Assembly. The party called on Gov. Andrew M. Cuomo to appoint a special prosecutor to investigate sexual harassment cases in the Assembly.

The allegations against Kellner apparently died with Collins, and there appears to have been no involvement by a legislative ethics panel, which is supposed to handle such cases. It was Collins, at Silver’s request, who handled the more recent secret settlement deal for $103,000 of taxpayer funds with two women who had accused now-former Assemblyman Vito Lopez of sexual harassment, groping and intimidation. It has taken months for Silver to try to rebuild relations with female legislators in the Assembly after the Lopez case.

In one Google Talk chat, the Times said Kellner wrote to the female staffer, who is in her early 20s, because “you were cute during the interview.” He said he “secretly” hoped she did not have a boyfriend. “I’d like being the only man in your life.” In another exchange, he wrote, “I wouldn’t mind falling asleep with you, but not remotely. Did I offend?”

Collins makes $145,496 as the Assembly’s counsel, according to the state comptroller’s office.

Michael Whyland, a Silver spokesman, said Silver was not told of the matter by Collins, who has been involved in a number of sensitive legal matters for the Assembly, including the case of a female staffer who claimed another top Silver adviser, Michael Boxley, has sexually attacked her. Boxley later resigned after he was arrested on rape charges involving a different woman; he pled guilty to misdemeanor sexual misconduct in that case.