When Kelly moved to the White House as Trump's top aide in July 2017, Nielsen went with him as his deputy.
Nielsen had recently warned a congressional panel of a "catastrophe" on the Southern border after the number of crossings hit a 10-year high.
According to CBS News, which first reported the news, Nielsen's departure was yet another victory for Stephen Miller, the far-right senior adviser in the White House who has consistently steered the president in a hardline direction on immigration.
She travelled to the US-Mexico border on Friday with Mr Trump to participate in a round-table with border officers and local law enforcement.
This is a developing story. There she echoed Trump's comments on the situation at the border, though she ducked out of the room without explanation for some time while Trump spoke.
Britain issues post-Brexit passports… before actually leaving the EU
March 30 was the original date set by the enacting of Article 50 for the exit of Britain from the European Union. Brexit has been delayed but it hasn't stopped new versions of British passports being issued.
Nielsen told Trump that would be a bad and even unsafe idea, and that the governor of Texas, Republican Greg Abbott, has been very supportive of the President. (Actual illegal border crossings are historically very low.) Reversing Trump's asylum-related policies, taking appropriate border security measures, increasing legal immigration as well as seasonal worker visas and regularizing those here illegally who meet certain requirements are the components of a rational policy. But she was also instrumental in ending the policy. "She got caught up in President Trump's anti-immigration machine". The Wall Street Journal reported in November that Trump had chose to replace Ms Nielsen.
"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.
Nielsen advocated for strong cybersecurity defense and often said she believed the next major terror attack would occur online - not by planes or bombs.
"When even the most radical voices in the administration aren't radical enough for President Trump, you know he's completely lost touch with the American people", said Senate minority leader Chuck Schumer, D-N.Y.
Kelly resigned as chief of staff on January 2 amid reports of a strained relationship with Trump.
He and Kirstjen Nielsen parted ways after urgent talks in the White House that followed a two-day visit to California, during which they viewed parts of the renovated border wall. "And the problem is, the nature of the crossers, of migrants, coming across the border has changed", said York.