President Donald Trump has for months urged his administration to reinstate large-scale separation of migrant families crossing the border, three U.S. officials with knowledge of meetings at the White House told NBC News.

Kirstjen Nielsen, Trump's outgoing Homeland Security Secretary, resisted, setting her at odds with the president.

According to two of the sources, Nielsen told Trump that federal court orders prohibited the Department of Homeland Security from reinstating the policy and that he would be reversing his own executive order from June that ended family separation.

Trump has been pushing this policy since January, the sources said, when the numbers of undocumented immigrants crossing the border began to rise.