WASHINGTON — President Trump moved to replace the top ranks of the Department of Homeland Security on Monday, a day after forcing the resignation of its secretary, Kirstjen Nielsen, as he accelerated a purge of the nation’s immigration and security leadership.
The White House announced the departure of Randolph D. Alles, the director of the Secret Service, who had fallen out of favor with the president even before a security breach at his Mar-a-Lago club that the agency effectively blamed on Mr. Trump’s employees.
Government officials, who asked not to be identified discussing personnel changes before they were announced, said at least two more top department figures were expected to leave soon as well: L. Francis Cissna, the head of United States Citizenship and Immigration Services, and John Mitnick, the department’s general counsel and a senior member of Ms. Nielsen’s leadership team.
The latest shake-up came just a day after Mr. Trump pushed out Ms. Nielsen during a Sunday afternoon meeting at the White House for not doing enough in his view to secure the border. And it came three days after Ronald D. Vitiello, the acting director of Immigration and Customs Enforcement and the president’s nominee to take the job permanently, was told to step aside so the administration could go in a “tougher direction,” as Mr. Trump put it.
The wave of departures of officials originally installed by Mr. Trump seemed to underscore his growing frustration with his own administration’s handling of immigration and other security issues. In recent days, Mr. Trump has threatened to close the southwestern border altogether only to back off and give Mexico a one-year warning in the face of concern about the economic effects of such a move.
The latest moves also appeared to be a housecleaning of officials associated with John F. Kelly, the president’s former chief of staff and his first homeland security secretary, who was pushed out at the end of last year after months of tension with Mr. Trump.
Mr. Alles, a retired Marine major general who goes by Tex and was the first person from outside the Secret Service to head the agency in more than a century, received instructions 10 days ago to come up with an exit plan and was expected to leave on his own timeline, according to officials familiar with the discussions. The president had soured on Mr. Alles a while ago, even making fun of his looks, calling him Dumbo because of his ears, two officials said.
The instruction to form an exit plan came before the arrest of a Chinese woman carrying a malware-laced device at Mar-a-Lago, exposing holes in the security of the private club. The Secret Service was so disturbed that it issued a statement faulting the Mar-a-Lago staff for not tracking its guests tightly enough.
Some Secret Service officials said on Monday that they suspected that Mr. Alles’s departure was accelerated in part because of the episode.
The White House made no mention of that in its statement announcing Mr. Alles’s departure.
Mr. Alles “has done a great job at the agency over the last two years, and the president is thankful for his over 40 years of service to the country,” Sarah Huckabee Sanders, the White House press secretary, said in the statement.
She said he will be replaced in May by James M. Murray, a career Secret Service official who has served as deputy assistant director overseeing protective operations.
Ms. Nielsen will be replaced on an acting basis by Kevin McAleenan, the Customs and Border Protection commissioner.
Speaking with reporters on Monday, Ms. Nielsen expressed no unhappiness about her departure and thanked Mr. Trump “for the tremendous opportunity” to serve her country and the employees of her department for their efforts to secure the nation.
“I share the president’s goal of securing the border,” she said. “I will continue to support all efforts to address the humanitarian and security crisis on the border. And other than that, I’m on my way to keep doing what I can for the next few days.”
But in recent weeks, Mr. Trump had asked Ms. Nielsen to close ports of entry along the border and to stop accepting asylum seekers, which she found ineffective and inappropriate, according to people briefed on the conversations.
She has been on the receiving end of presidential wrath for months. She arrived at the White House with a list of changes that she thought needed to be made to continue in the job, but Mr. Trump was determined to fire her. As one administration official put it, they had different meetings in mind when they sat down for 30 minutes alone in the White House along with only Mick Mulvaney, the acting White House chief of staff.
Congressional leaders were left on Monday trying to sort through the changes and what they could mean.
Senator Ron Johnson, Republican of Wisconsin and the chairman of the Senate Homeland Security Committee, complained about “congressional dysfunction” in addressing border security, but added, “I am concerned with a growing leadership void within the department tasked with addressing some of the most significant problems facing the nation.”