Homeland Security Secretary Kirstjen Nielsen brought her resignation letter with her when she met President Trump in the White House residence yesterday afternoon, top sources tell Axios.

Inside the room: She wasn't intent on quitting but was prepared to, sources tell us. The meeting went poorly, and Trump didn't even let her announce her "resignation." While she was racing to put out the letter (not that different from one she wrote after midterms), Trump tweeted that she "will be leaving her position."

"She was undercut at every turn," a source close to DHS said. "She's done everything she can do. The White House is eating their own."

Between the lines: Nielsen had been on the outs with some in the West Wing for at least six months, top officials tell us.

National security adviser John Bolton has felt the increase in immigration numbers made it clear that her policies weren't effective, and he thought the president should relieve her of her duties, a senior administration official said.

John Bolton has felt the increase in immigration numbers made it clear that her policies weren't effective, and he thought the president should relieve her of her duties, a senior administration official said. Last fall, Bolton took his advice about Nielsen to Trump, incurring the wrath of then-chief of staff John Kelly, a Nielsen protector.

Bolton took his advice about Nielsen to Trump, incurring the wrath of then-chief of staff John Kelly, a Nielsen protector. Back in October, accounts surfaced of a shouting match between Bolton and Kelly. It turns out that it was over Bolton's Nielsen conversation with Trump.

Be smart: Nielsen's departure empowers White House hardliner Stephen Miller.

A Republican Senate aide tells Axios: “Nielsen leaving will make conservatives who were getting fed up with DHS happy."

“Nielsen leaving will make conservatives who were getting fed up with DHS happy." "Real question will be who’s the [permanent] replacement and does that person have the credentials?"

will be who’s the [permanent] replacement and does that person have the credentials?" "Whoever replaces will have one hell of a confirmation hearing.”

Go deeper: Read the resignation letter