The moves highlight the high level of turnover of top officials during Trump's presidency, which began in January 2017. "Many wonderful candidates!" Trump tweeted.
Mr Trump had previously threatened to fire Ms Nielsen, who was viewed as resistant to some of the harshest immigration measures supported by the President and his aides, both around the border and on other matters like protected status for some refugees. The Federal Vacancies Reform Act allows acting officials to service 210 days without a formal nomination, possibly longer pending a confirmation.
In a statement posted to Twitter, McAleenan thanked Trump for the opportunity to serve and department employees for their work.
McAleenan's resignation comes amid reports that he also felt undermined by immigration hardliners in the administration who frequently appeared on conservative news outlets calling for tougher policies.
"What I don't have control over is the tone, the message, the public face and approach of the department in an increasingly polarized time", he said in an October 1 article. "That's uncomfortable, as the accountable, senior figure".
McAleenan previously served as commissioner of U.S. Customs and Border Protection after having served as acting commissioner since the beginning of the Trump administration.
He has also overseen agreements with the governments of Mexico, El Salvador, Guatemala, and Honduras that seek to collectively curb migration to the Southern border.
When asked whether he ever stood up to Trump, McAleenan told ABC News last May that he did and his relationship with the president was better because of it.
During his tenure, McAleenan introduced several initiatives to reduce a monthslong surge in migrants at the U.S. -Mexico border. And most recently, the administration made migrants ineligible for asylum if they crossed through a third country on their way to the U.S.
It was not immediately clear who would replace him.
The acting secretary's exit leaves the bare-bones leadership structure at DHS even thinner.
DHS was created after the September 11, 2001, terrorist attacks, and previous presidents have placed a high priority on having a Senate-confirmed leader running the department, which has 240,000 employees and a $50 billion annual budget. Ordinarily, it would be the Deputy Secretary, but that person is presently David Pekoske, who himself is serving as Acting Deputy Secretary of DHS. Trump told aides that McAleenan had the look he was going for, with the trim, stern demeanor of a federal agent.
A White House official with knowledge of the decision confirmed that it was McAleenan's decision.
Despite the praise, Mr. Trump never formally nominated Mr. McAleenan to run the agency.
But McAleenan, like others in the job before him, was opposed to an enforcement operation targeting families here illegally who were in the interior of the United States, saying it was not worth the resource drain given the crisis at the border. "I've been a career law enforcement officer".