Homeland Secretary Kirstjen Nielsen had her resignation letter in hand when she arrived at the White House on Sunday to meet with President Trump, according to a report on Monday.

Although Nielsen, who has been on the outs with Trump for months over immigration, carried the letter with her, she wasn’t intent on resigning but was prepared to, Axios reported.

The meeting in the White House residence didn’t go well, and Trump tweeted that she “will be leaving her position” and named an acting secretary before Nielsen could release her resignation letter.

The president thanked her “for her service” and named Kevin McAleenan, the commissioner of Customs and Border Protection, as her temporary replacement.

Trump and members of his administration, including national security adviser John Bolton, blamed Nielsen’s ineffective policies for the increasing flow of illegal immigrants at the southern border, the report said.

Bolton first approached Trump six months ago about getting rid of Nielsen, a move that angered then-White House chief of staff John Kelly, who has been a longtime supporter of and mentor to Nielsen.

“She was undercut at every turn,” a Homeland Security source told Axios. “She’s done everything she can do. The White House is eating their own.”

“I have determined that it is the right time for me to step aside,” Nielsen said in her letter. “I can say with confidence our homeland is safer today than when I joined the Administration.”

The ouster of Nielsen appears to mark Trump taking a harder line on immigration.

Last week, Trump suddenly pulled the nomination of Ronald Vitiello to head up Immigration and Customs Enforcement, saying he wanted to go in a “tougher direction.”