President Donald Trump tweeted Friday evening that acting Homeland Security Secretary Kevin McAleenan is stepping down.
But his departure ends an awkward period of leadership - one in which McAleenan delighted Trump by getting border crossing numbers to fall yet remained an outsider in an administration where top figures - including in his own department - were brash Trump supporters popular on conservative media. The official wasn't authorized to speak publicly and spoke to AP on condition of anonymity.
Mr McAleenan, 48, is the fourth person to serve as the head of Homeland Security during Mr Trump's tenure.
McAleenan has been more isolated in recent weeks after the departure of several top aides and close allies.
McAleenan served in the role for six months, replacing Kirstjen Nielsen, who sat at the helm of the powerful agency for 1.5 years.
Homeland Security, a 240,000-person department, is tasked with election security and cybersecurity, disaster response and even the Secret Service.
Homeland Security has been the cabinet post with the highest turnover in the Trump administration at this point. The president's signature issue makes the department his focus and his ire.
Trump had not nominated him to the post permanently, either.
McAleenan has since called the policy a mistake because, he said, it lost the public trust and was "not worth it".
A program that has turned away some 42,000 migrants to await their asylum claims in Mexico expanded under his watch. By the same token, he took fire from Democrats for barring immigration families from Central America in Mexico, where they were vulnerable to violence. "The President's threat of tariffs on Mexico provided McAleenan with more opportunity to engage with an historically intractable partner on border security, resulting in a precipitous decline in apprehensions along the southern border".
McAleenan is an attorney who spent 15 years working for U.S. Customs and Border Protection before being named acting CBP director in January.
And he didn't always agree with White House-pushed policies.
"Secretary McAleenan is doing a fantastic job implementing the president's plan to secure the southern border, build the wall, halt illegal immigration and stop the unsafe practice of catch-and-release", Hogan Gidley, the deputy White House press secretary, said in a statement to The Washington Post at the time.