"Kevin now, after many years in Government, wants to spend more time with his family and go to the private sector", Trump tweeted shortly before taking the stage at a rally in Lake Charles, La.
"Congratulations Kevin, on a job well done", Trump continued.
Mr. McAleenan became the fourth person to lead the agency under Mr. Trump in April after the Republican President asked for the resignation of Homeland Security Secretary Kirstjen Nielsen.
"We have worked well together with Border Crossings being Way down", Trump tweeted. 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.
McAleenan said that recently there has been a drop in apprehensions along the U.S. -Mexico border, with total enforcement actions for Central Americans who present at the border down more than 70 percent after Trump threatened Mexico with 5 percent tariffs if the government didn't do more to address the flow of illegal immigrants to the U.S. southern border.
The 240,000-person department is tasked with election security and cybersecurity, disaster response and even the Secret Service.
In a New York Times report last month, McAleenan was accused of telling federal immigration officials to ignore Trump's orders at the U.S. -Mexico border.
In the interim, Trump surrounded McAleenan with immigration hard-liners like Cuccinelli and Morgan, who support the president's more nativist approach.
Thompson said Trump "has forced the Department to stray from its core counterterrorism mission to be nearly singularly focused on his xenophobic and cruel immigration agenda".
During McAleenan's brief tenure, the Trump administration stepped up efforts to discourage an exodus of migrants from Honduras, Guatemala and El Salvador by asking Mexico to impede their transit and requiring them to apply for asylum in the first country they enter - meaning either Guatemala or Mexico. The president's signature issue makes the department his focus and his ire.