The military adviser to Sen. Kirsten Gillibrand, a 2020 presidential candidate who has been an outspoken supporter of the #MeToo movement and a campaigner against sexual misconduct in the military, kept his job despite allegations he sexually harassed a junior female aide.

Abbas Malik, an Iraq war veteran who served in the 101st Airborne Division, remained as one of Gillibrand's closest advisers even after his accuser resigned in protest at how her allegations against him had been dealt with, according to Politico. The woman is in her mid-20s, junior to and a decade younger than Malik, who is married and at whose wedding Gillibrand officiated.

Malik, 34, was abruptly dismissed last week after media inquiries into his conduct. He was first hired by Gillibrand in 2011 as a special assistant, served as her driver and was promoted to become her military adviser in 2015, according to LegiStorm and LinkedIn data.

The woman has accused Gillibrand of hypocrisy in protecting a powerful male staff member and abandoning a junior female staffer — a sharp contrast with her political rhetoric on sexual misconduct. The female aide had reported a string of unwelcome advances by Malik as well as crude, misogynistic remarks. Another former Gillibrand aide told Politico that Malik had commented that a woman "couldn’t get laid unless she was raped.” Malik was investigated but kept his job.

Malik enlisted in the U.S. Army in 2004, serving for a year in Iraq, and later joined the New York National Guard in 2011 when Gillibrand used Malik's personal story to help bolster support for the Hiring Heroes Act of 2011, a bill that was eventually signed into law by former President Barack Obama. Malik appeared with her wearing his Army uniform.

News of the dismissal left Gillibrand scrambling to limit the political damage. “These are challenges that affect all of our nation’s workplaces, including mine, and the question is whether or not they are taken seriously," she said in a statement to the Washington Examiner.

"As I have long said, when allegations are made in the workplace, we must believe women so that serious investigations can actually take place, we can learn the facts, and there can be appropriate accountability. That’s exactly what happened at every step of this case last year. I told her that we loved her at the time and the same is true today.”

In a letter from the accuser, which neither Gillibrand nor her other staff responded to, she wrote that she was resigned “because of how poorly the investigation and post-investigation was handled.”

[Related: Fox News' Chris Wallace corners Kirsten Gillibrand on Pfizer fundraiser]

She added: “Your office chose to go against your public belief that women shouldn’t accept sexual harassment in any form and portrayed my experience as a misinterpretation instead of what it actually was: harassment and ultimately, intimidation." The letter was obtained and published by Politico.

The U.S. senator for New York has become a key congressional ally for the #MeToo movement. But she angered many Democratic colleagues when in December 2017 she called on former Sen. Al Franken, D-Minn., to resign after eight women, including one Capitol Hill staffer, accused him of misconduct, such as groping and forcible kissing. Franken did resign but has denied many of the allegations leveled against him.

Gillibrand, who replaced former Secretary of State Hillary Clinton in the U.S. Senate in 2009, also rankled the Clinton camp in November 2017 when she suggested former President Bill Clinton should have stepped down as commander-in-chief in the 1990s over his affair with Monica Lewinsky.

Her interest in women’s rights predates #MeToo, spearheading efforts to combat sexual assault in the military since 2013, when she oversaw the first Senate Armed Services hearing on the matter in almost a decade.

Whitney Mitchell Brennan, Gillibrand's communications director, told the Washington Examiner in a statement: “Unfortunately, no workplace is exempt from employee misconduct, including ours. What’s important is that when an individual reports allegations of sexual harassment or discrimination in our workplace, an immediate and thorough investigation is conducted in consultation with experts, which is precisely what occurred in this case.

[Also read: 'Ranch Girl' squeezes past Kirsten Gillibrand at Iowa restaurant in viral video]

“At every step of the process, immediate action was taken by the office. The previous allegations in question were investigated in consultation with Senate Employment Counsel, and included multiple interviews with relevant current employees who could potentially corroborate the claims. A full and thorough investigation into the evidence revealed employee misconduct that, while inappropriate, did not meet the standard for sexual harassment. However, because the office did find unprofessional behavior that violated office policy, including derogatory comments, the office took strong disciplinary action against the employee in question and he was given a final warning.

“Recently, we learned of never-before reported and deeply troubling comments allegedly made by this same individual. The office immediately began another investigation and interviewed relevant witnesses, which has led to the office terminating the employee from staff last week.

“Senator Gillibrand is committed to ensuring allegations are handled seriously, investigated, and followed by appropriate punishment, which is why she helped pass stronger sexual harassment protections in Congress and prioritizes proper harassment training to better prevent these occurrences and encourage future reporting.”

[Also read: Kirsten Gillibrand vying to be the 'vice' president]