WASHINGTON — President Trump moved to clear out the senior 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 to four more high-ranking figures affiliated with Ms. Nielsen were expected to leave soon, too, hollowing out the top echelon of the department managing border security, presidential safety, counterterrorism, natural disasters, customs and other matters.
The wave of departures of officials originally appointed by Mr. Trump underscored 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 notice in the face of warnings about deep economic damage from such a move.
The shake-up, coming more than two years into Mr. Trump’s term, indicated that he is still searching for a team that will fulfill his desire for an even tougher approach to immigration. It also signaled the enduring influence of Stephen Miller, the president’s hard-line senior adviser who has complained about recalcitrant homeland security officials.
Some of the president’s allies complained that he was going too far, taking out subordinates who actually share his goals on immigration at the prodding of White House aides hunting for scapegoats for the failure to control the border as he has promised to do.
“Without names, there’s people in the White House that speak about immigration,” Senator Charles E. Grassley, Republican of Iowa, said in an interview. “They haven’t accomplished a whole lot, so they need to find some other way to make themselves look important.”
The latest shuffle came just a day after Mr. Trump pushed out Ms. Nielsen for not doing enough in his view to secure the border and three days after Ronald D. Vitiello, the acting director of Immigration and Customs Enforcement, was told to step aside so the administration could go in a “tougher direction,” as Mr. Trump put it.
Officials said they expect to see the departures of L. Francis Cissna, the head of United States Citizenship and Immigration Services; Kathy Nuebel Kovarik, one of his top deputies; and John Mitnick, the department’s general counsel and a senior member of Ms. Nielsen’s leadership team. All of them were said to be viewed by Mr. Miller as obstacles to implementing the president’s policies.
The White House is also pressing for the resignation of Claire Grady, the acting deputy secretary, who under law would normally fill in for Ms. Nielsen. Mr. Trump has already announced that he will install Kevin K. McAleenan, the Customs and Border Protection commissioner, as Ms. Nielsen’s acting replacement, which he cannot do if Ms. Grady remains in place.
The latest moves 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 served with Mr. Kelly in the military and goes by Tex, was the first person from outside the Secret Service to head the agency in more than a century and some administration officials said he had a hard time fitting in.
At Mr. Trump’s instruction, Mick Mulvaney, the acting White House chief of staff, told Mr. Alles at least 10 days ago to expect a transition after two years in office and to develop an exit plan, according to officials familiar with the discussions.
Mr. Trump, who talks with members of his own Secret Service detail, had soured on Mr. Alles a while ago, convinced that as an outsider he was not popular among the agents, officials said. The president even made fun of the director’s looks, calling him Dumbo because of his ears. But a Secret Service ally of Mr. Alles disputed the notion that he did not fit in, saying that the director was well liked among the work force.
Mr. Alles was told to develop an exit plan 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 club’s staff for not tracking its guests closely 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 issued shortly after it was reported by CNN.
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 would be replaced in May by James M. Murray, a career Secret Service official who oversees protective operations.
Mr. Alles was the focus of an early fight between Mr. Trump and Mr. Kelly in the first months of the administration. Mr. Kelly threatened to resign as homeland security secretary if Mr. Alles was not made Secret Service director, according to former administration officials.
In an email message to his work force on Monday, Mr. Alles confirmed that his departure was ordered by the president last month.
“No doubt you have seen media reports regarding my ‘firing,’” he wrote. “I assure you that this is not the case, and in fact was told weeks ago by the administration that transitions in leadership should be expected across the Department of Homeland Security.
“The president has directed an orderly transition in leadership for this agency and I intend to abide by that direction,” he added. “It is my sincere regret that I was not able to address the