"Secretary of Homeland Security Kirstjen Nielsen will be leaving her position and I would like to thank her for her service," Trump wrote on Twitter after meeting with Nielsen Sunday afternoon.
The president added that U.S. Customs and Border Protection Commissioner Kevin McAleenan will become the agency's acting secretary.
"I have confidence that Kevin will do a great job!" Trump wrote.
Nielsen said she will remain in the post through Wednesday to ensure an "orderly transition" of leadership.
Her departure comes more than a year after Nielsen was confirmed to take over the post from John Kelly when he became the president's chief of staff. She served as Kelly's chief of staff before her Cabinet-level promotion.
Nielsen oversaw the department through a number of highly scrutinized actions on immigration policy, including the administration's zero-tolerance approach to separating migrant children from their parents. Under the policy, the Trump administration sought to prosecute "100 percent" of adults who crossed the border illegally and more widely implement the child separation policy that previous administrations used sparingly.
The policy over the spring and summer of 2018 left thousands of migrant children separated from parents and housed in tent cities. Criticism of the separations prompted Trump to sign an executive order ending the practice in June, though in October he said he was "looking at everything" when asked if he was considering a new family separation policy.
Last month, Nielsen wrote an "urgent request" to Congress to grant the DHS resources and new powers to deport unaccompanied minors back to their home countries.
Under Nielsen's tenure, DHS also issued a new rule with the Department of Justice preventing people who cross the border illegally from seeking asylum. Trump signed a proclamation enforcing the rule last week.
Under the new order, immigrants who cross illegally will be be held in detention until deportation, ending the "release" portion of the United States's so-called "catch and release" policy in which migrants are arrested and then freed pending a court date.
Nielsen previously worked in DHS as a senior legislative policy director for Transportation and Security Administration under President George W. Bush. In Bush's administration, she also served as special assistant to the president and senior director for prevention, preparedness and response on the White House Homeland Security Council.