For weeks, Donald Trump has been souring on his Chief of Staff John Kelly because of his controlling ways and rising public profile. And now Kelly is in the midst of a bonafide crisis, one that exacerbates the president’s own #MeToo problems. On Tuesday, Kelly strongly defended White House Staff Secretary Rob Porter against disturbing allegations, first published in the Daily Mail, that he abused his ex-wives. Kelly’s decision to back Porter has left many people inside the White House angry, two sources with knowledge of the matter said. On Wednesday afternoon, Porter resigned. Axios reported Kelly wanted Porter to “stay and fight.”

Yesterday, Porter’s second wife, Jennifer Willoughby, told the Mail that Porter called her a “fucking bitch” on their honeymoon, and once pulled her naked out of the shower. In response, Kelly put out a statement calling Porter “a man of true integrity and honor” and a “trusted professional.” But shortly after Kelly rallied behind his colleague, Porter’s first wife came forward with additional harrowing allegations. Colbie Holderness, who married Porter in 2009, told the Daily Mail that Porter punched her in the face and choked her, among other alleged abuses. The article included a photo of her with a black eye. “It was not hard enough for me to pass out, but it was scary, humiliating, and dehumanizing,” she said. Porter told the Daily Mail that the allegations were “slanderous and simply false.”

Kelly’s decision to go to bat for Porter deeply frustrated White House staffers, sources told me. He was supposed to be the West Wing’s resident grown-up, but staffers are increasingly questioning Kelly’s judgment, four Republicans close to the White House told me. “It’s beyond disbelief. Everyone is trying to figure out why Kelly is leading the charge to save him,” one former West Wing official said. Another Republican said: “How many times has Kelly put out a statement defending Trump?”

Sources said Kelly was so quick to defend Porter because the two have grown very close since Trump appointed Kelly chief of staff last summer. Porter, a Rhodes scholar, has helped Kelly instill discipline in the West Wing. Kelly has told people that Porter has a “calming effect” on White House operations. For instance, it’s Porter who screens all the information that gets to Trump’s desk. Porter also helped Kelly conduct a West Wing organizational study that provided Kelly with a cudgel to sideline Ivanka Trump and Jared Kushner, two former West Wing officials told me. The officials also said Kelly supported Porter even after the F.B.I. delayed granting Porter’s security clearance because they uncovered his alleged history of spousal abuse.

Until now, Porter has been a low-profile player, publicly absent from the West Wing dramas. But last week, he emerged when the Daily Mail reported he’s dating White House Communications Director Hope Hicks. Then, on Tuesday, the paper contacted the White House with questions about Porter’s alleged battery. According to one person briefed on internal White House conversations, Kelly let it be known he wanted to defend Porter publicly. In a series of crisis meetings, the statement was drafted by Hicks, White House Press Secretary Sarah Huckabee Sanders, and Kushner’s White House spokesman, Josh Raffel. (Porter, Hicks, and Raffel attended a dinner last week that was reported in the Daily Mail piece.)

The White House did not respond to requests for comment.

Even before the blowback from the Porter statement, the White House was struggling to walk back Kelly’s inflammatory comments on immigration. Yesterday, Kelly said on Capitol Hill that some undocumented immigrants were “too lazy” to sign up for the Deferred Action for Childhood Arrivals program.