Homeland Security Secretary Kirstjen Nielsen talks outside her home in Alexandria, Va., on Monday, April 8, 2019. Nielsen says she continues to support the president’s goal of securing the border in her first public remarks since her surprise resignation. (AP Photo/Kevin Wolf)

Homeland Security Secretary Kirstjen Nielsen talks outside her home in Alexandria, Va., on Monday, April 8, 2019. Nielsen says she continues to support the president’s goal of securing the border in her first public remarks since her surprise resignation. (AP Photo/Kevin Wolf)

WASHINGTON (AP) — President Donald Trump had had it.

The flow of migrants at the southern border was surging. Another caravan appeared to be forming. And his government had run out of holding space, forcing the release of tens of thousands of families apprehended at the border.

During a meeting with senior aides on the last Thursday in March, Trump demanded drastic action to make good on the threat he’d tweeted that morning: Shut the southern border. Curbing illegal immigration was his signature issue, he railed. Why couldn’t he deliver?

Homeland Security Secretary Kirstjen Nielsen urged the president to reconsider. Her agency had already diverted hundreds of border agents away from certain crossings to process migrant families elsewhere, creating what would soon become considerable bottlenecks. Closing ports completely, she reasoned, would only encourage migrants to cross elsewhere — illegally.

ADVERTISEMENT

Trump wasn’t having it. Shut the ports at El Paso, Texas, at noon tomorrow, he ordered. End of meeting.

The directive set off a frantic behind-the scenes push to get Trump to change his mind, and he ultimately relented. But the episode launched a turbulent 12-day stretch that would lead to the eventual resignation of Nielsen , the potential dismissal of much of her agency’s top leadership and the beginning of a new phase in which immigration hard-liners at the White House are determined to wield considerably more influence over Homeland Security.

This account is based on interviews with 20 administration officials, congressional aides and people familiar with the events, many of whom spoke on condition of anonymity because they were not authorized to discuss internal deliberations.

___

ON BORROWED TIME

Trump and Nielsen’s relationship was never especially close. Nielsen had been picked for the top Homeland Security job at the urging of her predecessor, John Kelly , who left to become Trump’s White House chief of staff . Trump had always been suspicious of her, in part because she’d worked for former President George W. Bush. She had been widely expected to leave the department last fall after Kelly’s departure from the White House, but she appeared to get back on Trump’s good side during the government shutdown, when she served as one of the top defenders of his push to build a southern border wall.

But Nielsen took the brunt of Trump’s fury over rising border crossing numbers, and the situation was only getting worse. Aides spent months desperately trying to come up with new solutions, and some tried to steer Trump away from more drastic measures, including his talk of reinstating the family separation policy that prompted international outrage.

ADVERTISEMENT

While Nielsen had doubts at times, she had dutifully carried out Trump’s orders, taking ownership of his most divisive policies, including the family separations, and spending months trying to broker arrangements with Central American countries and Mexico. But it also fell to Nielsen to explain to Trump the legal limits of things he wanted to do. And he didn’t like it.

It didn’t help that Kelly had been critical of Trump in appearances since he left the White House — something Trump held against Nielsen. Or that John Bolton, Trump’s national security adviser, had been pushing for Nielsen’s ouster since last fall, telling Trump he didn’t think her leadership or policies were effective.

___

A TRIP CUT SHORT

Nielsen had just landed in Europe last week for her first time as secretary when she decided to rush back to Washington, landing early Tuesday morning.

Though aides had succeeded in talking Trump down from his border closure threat the week before, he had continued to crank up his rhetoric, warning by tweet that if Mexico didn’t “immediately stop ALL illegal immigration coming into the United States through our Southern Border,” he would be “CLOSING” the border, or large sections of it within a week.

By Wednesday, Nielsen was at the border, overseeing efforts to keep asylum seekers in Mexico and preparing for the president’s Friday visit to Calexico, California.

But the night before Trump’s visit, a puzzling notice arrived on Capitol Hill: Trump was withdrawing his nomination of Ron Vitiello to permanently lead the U.S. Immigration and Customs Enforcement agency. It had to be a mistake, staffers reasoned. Why would Trump be spiking his own nominee, a well-respected and longtime border official who appeared to be cruising to confirmation?

Vitiello got a call that night from senior Trump aide Stephen Miller informing him that he wouldn’t be joining the president on his trip to the border the next morning. There was no explanation.

Nielsen had received no heads-up.

But word began to spread that his nomination was being yanked.

“We want to go in a tougher direction” was all Trump told reporters as he left the White House on Friday morning.

It was Step One of the plot to purge DHS leadership.

Nielsen joined Trump at the border, echoing his words at a roundtable with border officers and local law enforcement and standing by Trump’s side as they toured a section of newly rebuilt border fencing, introducing him to local officials.

But inside she was fuming.

___

DUSTING OFF A LETTER

Nielsen returned to Washington on a Coast Guard Gulfstream as Trump continued onto California and Nevada to do some fundraising. By that night, murmurs were swirling that Vitiello’s removal wasn’t a one-off and that Miller was orchestrating a wholesale leadership overhaul of her department.

Already frustrated by what she saw as insufficient help from departments like Justice and Health and Human Services, with clear signs that White House hard-liners were on the ascent, Nielsen pulled up the resignation letter she’d written months before — just in case.

She went into a Sunday White House meeting with Trump that she’d requested not sure if she’d be fired, resign or stay to fight another day.

It was, by all accounts, a cordial conversation in the Yellow Oval Room of the White House residence, with acting chief of staff Mick Mulvaney in attendance. Nielsen had come prepared with a list of ideas to share with the president. But the two quickly agreed the arrangement was no longer working. Trump wanted to go in a different direction.

Nielsen resigned on the spot. Trump tweeted the news before she could get her letter out.

___

THE PURGE

Standing outside her home in Alexandria, Virginia, on Monday, Nielsen sounded just as loyal to Trump as she had at the border.

“I will continue to support all efforts to address the humanitarian and security crisis,” she said, thanking the president “for the tremendous opportunity to serve this country.”

By the end of the day, the department she had led appeared to be on the cusp of being dismantled, with the head of U.S. Citizenship and Immigration Services and the department’s general counsel among those expected to be pushed out.

“It’s time to do things a little differently,” White House spokesman Hogan Gidley said on Fox News Channel. “And so the president’s looking around to reshape his team so he can have the people in place to carry out his agenda.”

___

Associated Press writer Zeke Miller contributed to this report.