Kevin McAleenan has resigned from the Trump administration just six months after taking over as acting homeland security secretary.

President Trump announced McAleenan’s departure in a series of tweets late Friday, saying McAleenan wanted to “spend more time with his family and go to the private sector.”

“Kevin McAleenan has done an outstanding job as Acting Secretary of Homeland Security. We have worked well together with Border Crossings being way down,” Trump wrote. “Congratulations Kevin, on a job well done! I will be announcing the new Acting Secretary next week. Many wonderful candidates!”

In a statement of his own, McAleenan thanked Trump for the opportunity to serve at DHS. “With his support, over the last 6 months, we have made tremendous progress mitigating the border security and humanitarian crisis we faced this year,” he wrote.

According to CNN, McAleenan submitted his resignation on Friday despite some White House officials attempting to talk him out of it. His exit comes just a few weeks after he vented frustrations in an interview with The Washington Post, saying it has been “uncomfortable” to lead the agency when he has no control over “the tone, the message, the public face and approach of the department in an increasingly polarized time.”

A senior DHS official said McAleenan “will be greatly missed.”

“He is highly respected by the workforce,” the official said. “He provided needed stability and principled leadership for the department.”

His departure has, once again, thrown the department into a state of uncertainty.

One DHS official, who spoke to The Daily Beast on condition of anonymity, said the administration will be “hard-pressed” to find another person with “experience, pedigree and law enforcement bona fides” to take such a thankless job.

“What on earth would be the incentive?” the official asked. “He is incredibly well-respected by civilian and political leadership on both sides of the aisle. That kind of buy-in takes an entire career to build and it still didn’t insulate him from turmoil.”

McAleenan, who took over the position in April after Kirstjen Nielsen was ousted, was never nominated by Trump to permanently serve as DHS chief. Despite winning praise within the administration for expediting the construction of border barriers along the southern border and playing a key role in the Trump administration’s controversial family separation policy—which he later conceded “went too far”—McAleenan has largely been seen as a figure who never really blended into Trumpworld.

Less than a week before his resignation, he was heckled and shouted down while speaking at an event at Georgetown University. Protesters held up signs reading, “Hate is not normal,” and shouted the names of migrant children who died in U.S. government custody. McAleenan left the event without finishing his speech.

There were other signs that McAleenan was on his way out.

His speech at the Border Patrol Foundation last night that sounded like a farewell, according to a source briefed on the event. During the address, McAleenan thanked his wife and teared up.