Homeland Security Secretary Kirstjen Nielsen is leaving her position, President Donald Trump said on Twitter Sunday.

Kevin McAleenan, commissioner of Customs and Border Protection, will become acting secretary pending confirmation of Nielsen's successor, Trump said.

Nielsen's resignation was first reported by CBS News.

As recently as last week, Nielsen was busily announcing plans to reassign hundreds of Customs and Border Protection agents to the southern border to "address the influx of migrants" in certain areas.

But Nielsen, 46, has suffered from tepid support within the administration, taking public responsibility for Trump's deeply divisive anti-immigration policies. The president has reportedly expressed displeasure with her job performance.

In November, The Washington Post quoted White House officials as saying Trump was planning to fire her.

The White House last week unexpectedly withdrew the nomination of Ronald Vitiello to be head of Immigration and Customs Enforcement, and Nielsen has run Homeland Security, the federal government's third-largest department, without a deputy ever since she succeeded John Kelly at Homeland Security in December 2017 after Kelly became White House chief of staff.

She has also faced fierce criticism from within and outside the department, which is the subject of numerous House subpoenas and more than 20 investigations by the agency's own inspector general.

Nielsen entered government as the director of prevention, preparedness and response for the White House Homeland Security Council during the administration of President George W. Bush. She returned to the White House as Kelly's chief of staff at Homeland Security before succeeding him late in the year.

McAleenan, who was confirmed as head of CBP, the nation's largest law enforcement agency, in March 2018, was the agency's deputy commissioner during President Barack Obama's administration.

His confirmation to head CBP was delayed for more than three months as allegations emerged that anonymous accusers had alleged that McAleenan had an affair with a subordinate and bypassed proper channels to fund an immigration detention center. DHS' inspector general cleared him of wrongdoing at the time.

CBP came under investigation by the House Homeland Security Committee last month after NBC News and NBC Sand Diego reported that it had compiled a list of 59 reporters, lawyers and activists, most of them U.S. citizens, who were to be stopped for questioning crossing the U.S.-Mexican border at San Diego-area checkpoints. At least 21 of them have been stopped and questioned or arrested.

"CBP does not target journalists for inspection based on their occupation or their reporting," the agency responded. "CBP has policies in place that prohibit discrimination against arriving travelers and has specific provisions regarding encounters with journalists."