"I want to thank the President for the opportunity to serve alongside the men and women of the Department of Homeland Security", he said in statement after the announcement. He quickly found himself hounded by the media and Democrats, both opposed to Trump's policies on immigration and securing the southern United States border.
In the President's tweet, he said McAleenan is leaving his position to "spend more time with and family" and work in the "private sector".
McAleenan was the fourth official to lead the DHS under Trump and the second Acting secretary.
Trump had not nominated him to the post permanently, either.
A person close to McAleenan said he resigned Friday after weeks of growing disenchantment with his standing in the administration.
McAleenan weathered that storm, but Mark Morgan, acting head of Customs and Border Protection, and Ken Cuccinelli, acting head of US Citizenship and Immigration Services, have often seemed the mouthpiece for the department, often on television fronting Trump's policies, while McAleenan was behind the scenes working on agreements to stop the flow of migrants.
In an interview, Mr McAleenan lamented not having control over "the tone, the message, the public face and approach of the department in an increasingly polarised time". "That's uncomfortable, as the accountable, senior figure".
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.
There is no indication as of yet who might replace McAleenan as Acting Secretary. Among those policies, criticized by Democrats, is the so-called "Remain in Mexico" program that has sent more than 50,000 migrants to Mexico to wait for their immigration cases to be processed in US courts. Those included allowing USA officials to detain migrant families with children for longer periods of time and working with Central American countries to create asylum agreements in which asylum-seekers would apply for refuge in Central America instead of the Untied States.
It was unclear whether McAleenan's departure was effective immediately.
The acting secretary's exit leaves the bare-bones leadership structure at DHS even thinner. Ordinarily, it would be the Deputy Secretary, but that person is presently David Pekoske, who himself is serving as Acting Deputy Secretary of DHS.
McAleenan took over in April after Secretary Kirstjen Nielsen quit. Trump told aides that McAleenan had the look he was going for, with the trim, stern demeanor of a federal agent.
Trump said in June that he was preparing to place former Immigration and Customs Enforcement director Tom Homan in the role of a White House "border czar".
However, McAleenan was sometimes at odds with the White House.
McAleenan has been at the helm of numerous immigration policies that have curbed illegal immigration at the southern US border and made it harder for migrants to apply for asylum.