Mr McAleenan is a longtime border official who is well-respected by members of Congress and within the administration.
Nielsen has not been the only casualty of the administration's new strategy.
President Donald Trump confirmed Nielsen's departure - and Kevin McAleenan's appointment - on Twitter late Sunday.
In her resignation letter, Nielsen asked for more from Congress and the courts, which have opposed such Trump administration initiatives as his effort to limit immigration from Muslim nations and the border wall.
Nielsen's exit marks the end of a hard relationship with her boss, who was said to be unhappy with her performance despite her unswerving loyalty and full-throated defence of the president's most controversial policies. She did not realize how dire it was when she left the U.S. last weekend, but quickly did, as she abruptly returned.
McAleenan said Border Patrol is unable to secure the border, with nearly 40 percent of its resources being diverted to deal with the large groups of Central Americans.
And in any case the children taken from their parents after crossing the border were "well taken care of", she insisted.
Her relationship with Mr Trump is said to have been hard, although in public she has been unwaveringly loyal to the administration.
The Secretary of Homeland Security leads the third-largest department of the USA government, with a workforce of 229,000 employees, according to its website.More news: Trump 'not concerned' with security breach at Mar-a-Lago
Rep. Mike Rogers of Alabama, the top Republican on the House Homeland Security Committee, acknowledged Nielsen's challenges in a statement and expressed confidence in McAleenan and whomever the President nominated later.
La secretaria de Seguridad Nacional, Kirstjen Nielsen, en el escenario para hablar se sube al escenario mientras es presentada para hablar en la convención de la Asociación Nacional de Jefes de Policía en Nueva Orleans, el lunes 18 de junio de 2018.
"I said it before, but I really fear for our democracy when the body who creates the laws is telling the body who enforces the law, 'just don't enforce the law, '" Ms. Nielsen had told Fox News last month.
Though Trump aides were eyeing a staff shake-up at Homeland Security and had already withdrawn the nomination for another key immigration post, the development Sunday was unexpected.
Trump cut aid to those three countries last month in response to the surge.
Democrats have long called for Nielsen's resignation, albeit for different reasons. "He knows the border. he will start day one".
"We are now on pace for over 100,000 apprehensions and encounters with migrants, with 90 percent - 90,000 - crossing the border illegally between ports of entry".
"Right now, we have an emergency on our hands".
Trump's frustrations were placed on Nielsen's head, the Washington Post reported.
Nielsen, who served in President George W. Bush's administration, never overcame internal skepticism about her allegiance to Trump.