When White House staff secretary Rob Porter announced Wednesday that he would resign following allegations of domestic abuse, the White House was still circulating statements defending Porter.

However, despite the White House’s projection of ignorance about the accusations against Porter (pictured above on the right), several reports reveal that administration officials were aware of the allegations from Porter’s ex wives before the news broke publicly and worked to keep him on staff anyway.

Top aides in the White House were aware that allegations of domestic abuse were holding up Porter’s application for a full security clearance, CNN and Politico reported. Chief of staff John Kelly, who worked closely with Porter, was among the officials who knew about the accusations, per Politico, and some officials were aware of the allegations for months, according to CNN. The President was unaware of the allegations before Tuesday’s report in the Daily Mail about the ex-wives’ allegations, two officials told Bloomberg News.

An ex-girlfriend of Porter, who also works in the Trump administration, also reached out to White House counsel Don McGahn in recent weeks when she learned Porter was romantically involved with White House Communications Director Hope Hicks, and she warned McGahn about the abuse allegations from Porter’s ex-wives, Politico reported.

Though the allegations of domestic violence reportedly kept Porter from obtaining a full security clearance, the White House kept him on staff. Porter was a crucial part of White House operations and frequently traveled with President Donald Trump. He also participated in some National Security Council meetings in which classified material was discussed, per Bloomberg News.

Two White House officials told the New York Times that Porter misled Kelly about the allegations and claimed that his ex-wives were fabricating stories and just trying to cause trouble.

When the news of the allegations against Porter first broke on Tuesday, the White House stood by the top aide, releasing statements with effusive praise for Porter. Kelly called Porter a “man of true integrity and honor,” and Porter’s former boss, Sen. Orrin Hatch (R-UT) slammed reports about Porter’s past.

Kelly fought for Porter to stay on staff, telling him that he would be able to withstand the allegations, according to CNN and Axios. Hicks also pushed for Porter to stay on, according to CNN.

However, by Wednesday afternoon, the Intercept had published a new interview with one of Porter’s ex-wives, along with photos of her bruised face, and the outlet reported that Porter’s ex-wives told the FBI about his past abuse.

The escalating coverage prompted Porter to resign, but the White House was still circulating the statements offering praise for the top aide on Wednesday afternoon. White House Press Secretary Sarah Huckabee Sanders told reporters that Porter was not pressured to resign and that he would not leave his post in the administration immediately.

By Wednesday night, the White House’s tune changed yet again, and a senior administration official said Porter would leave the White House in the next 48 hours, according to the Washington Post. Kelly also issued an updated statement indicating surprise about the allegations against Porter.

“I was shocked by the new allegations released today against Rob Porter. There is no place for domestic violence in our society,” Kelly said, though he went on to say in the statement that he stood by his previous comments about Porter’s work.