WASHINGTON — Pressure mounted on White House chief of staff John Kelly as questions swirled Friday about his defense of a senior aide he fought to keep in a highly sensitive West Wing job despite accusations of spousal abuse from two ex-wives.

White House staff secretary Rob Porter, a member of President Donald Trump’s inner circle and arguably Kelly’s closest aide, cleaned out his desk on Thursday. But the aftershocks of his resignation reverberated amid concerns about his access to classified information and about how long senior staffers knew about the allegations.

Though the accusations against Porter became public this week, Kelly learned last fall that something was amiss with the staff secretary’s attempts to get a security clearance, according to an administration official who insisted on anonymity to discuss internal matters.

The chief of staff had sought information about the status of security clearance applications for top aides, and it was then he learned there were allegations against Porter from his ex-wives, said the official. Porter and Kelly later discussed the allegations. Meanwhile, White House counsel Don McGahn was apprised of the allegation in early 2017, the official said.

The White House official said that staffers felt misled about how Porter downplayed the allegations, both to Kelly and McGahn. Kelly himself faced criticism for initially defending his aide — only to later shift course after the publication of photos showing one of Porter’s ex-wives with a black eye.

“It’s fair to say we all could have done better over the last few hours or last few days in dealing with this situation,” said White House deputy press secretary Raj Shah, who faced a barrage of questions about Kelly during a press briefing.

WATCH: White House says it’s still confident in chief of staff Kelly

Kelly sent a memo to staff late Thursday in which he wrote that “while we are all processing the shocking and troubling allegations made against a former White House staffer, I want you to know that we all take matters of domestic violence very seriously. Domestic violence is abhorrent and has no place in our society.”

He added that resources would be available to any White House staffer who would like to seek counseling.

When the allegations first emerged against Porter a number of senior aides rallied around him, and the White House acknowledged that personal relationships may have played a role in their response. Communications Director Hope Hicks, who was dating the staff secretary, helped draft the original statements defending him, according to three current and former White House officials.

Shah said Thursday that Hicks later “recused” herself from some aspects of the matter, but it was unclear from what. Kelly, meanwhile, was Porter’s loudest defender, including in the first hours after the graphic photos of alleged abuse emerged.

Only later did the chief of staff, who had argued for Porter to keep his post, release a second statement in which he said he supported Porter’s resignation.

Shah said that Trump was not aware until Tuesday of the accusations against Porter, who was a frequent presence in the Oval Office and helped craft last week’s State of the Union address. By the time the president was fully briefed of the claims against Porter on Wednesday, the once-rising White House star had already resigned, according to the official.

A number of lawmakers criticized Kelly, and a leading women’s group called for the chief of staff to resign.

READ MORE: How is John Kelly’s credibility hurt by Rob Porter abuse scandal?

The president, for his part, has not signaled to allies that he is on the verge of making a change. But his frustration with Kelly has grown in recent weeks.

Trump has long resisted Kelly’s attempt to control him. In recent weeks, the president has complained about the chief of staff to his circle of informal advisers, according to two people who speak to the president regularly but are not authorized to publicly discuss private conversations. One of the people said Trump was angry that Kelly did not bring the Porter allegations to him sooner.

Kelly also drew Trump’s ire last month when he seemed to suggest that the president was flip-flopping on his call for a border wall. Trump complained to aides that the chief of staff had portrayed him as a child who had to be managed, a contention that particularly irked the president in the wake of the way he was portrayed in the recent Michael Wolff book, “Fire and Fury.”

Though Trump frequently vents about senior aides, he is often loath to fire staffers. A dismissal of Kelly would surely revive the narrative of a White House in crisis as it faces the ongoing Russia probe and the midterm elections.

But Kelly’s handling of the Porter affair rattled some aides, who questioned his full-throated defense of an accused batterer, according to more than a half-dozen White House officials and outside advisers who were not authorized to speak publicly about private conversations.

Democratic swiftly called for an investigation into Porter’s presence at the White House.

“If John Kelly is covering this up, he needs to be held accountable,” Sen. Jon Tester, D-Mont., told CNN’s “New Day,” adding, “He better have a really good reason. Otherwise, he’s gone, too.”

Toni Van Pelt, head of the National Organization for Women, was more direct. She revisited the accusations that Trump himself has sexually harassed women, allegations he has denied.

“White House chief of staff John Kelly must resign,” said Van Pelt. “His pathetic defense of staff secretary Rob Porter reveals his true nature — an enabler of sexual abusers, a betrayer of trust and an avoider of responsibility.”

The White House was also put on the defensive about Porter’s interim security clearance, fielding questions about how someone could handle some of the nation’s most sensitive documents while potentially being ripe for blackmail. In Thursday’s briefing, Shah outlined the background check procedure, which is run by the federal law enforcement and intelligence agencies and was still underway for Porter.

READ MORE: White House aide Rob Porter resigns after allegations of spousal abuse

Attorneys who specialize in security clearance said Porter should have disclosed the allegations, including the protective order granted to one woman, when he filed his lengthy national security application. John V. Berry, who represents government employees and contractors, said the FBI would have notified the White House about the allegations but noted that the interim clearance would not have prohibited Porter from having access to sensitive information.

Both of Porter’s ex-wives have detailed the nature of the abuse they said they suffered at Porter’s hands and said they informed the FBI. One of them, Jennifer Willoughby, posted about it in detail on Instagram in April 2017 and wrote of Porter that “When I tried to get help, I was counseled to consider carefully how what I said might affect his career.”

She wrote again Thursday that she hoped her “story and my words can be a beacon forward for anyone who needs to be reminded: You are seen. You matter. You are enough.”

Kelly was brought into the West Wing to bring calm to Trump’s tumultuous operation but recently has created some of his own chaos, rattling aides and lawmakers with inflammatory remarks and political missteps.

For many staffers, Kelly had brought a much-needed sense of order to a White House that had been riven with rivalries and was frequently upended by the whims of a mercurial president. Kelly, along with Porter, helped organize the West Wing’s policy and decision-making process and infused the staff with a clearer sense of purpose, officials said.

But that semblance of confidence has been eroded.

Kelly’s claim Tuesday that some immigrants are “too lazy to get off their asses” and register for government protections stunned some aides who questioned the chief of staff’s political instincts and were dismayed by his language.

___

AP reporters Darlene Superville and Juliet Linderman contributed.