U.N. Ambassador Nikki Haley, who abruptly announced her departure Tuesday, will leave behind a job she helped elevate to one of the most influential in the Trump administration, raising the stakes for her successor and fueling speculation about her future.

Haley served almost as a shadow secretary of state during the first year of the administration, wielding more influence than the man who held the job, Rex Tillerson, and winning the confidence of President Trump with her strong defense of his policies at an institution filled with foreign officials opposed to his worldview, even as he sometimes chafed at her ambition.

Her influence has been curtailed in recent months as new national security adviser John Bolton and Secretary of State Mike Pompeo reclaimed policy and political ground that their predecessors ceded, but she departs with her relationship with Trump intact.

“She’s done a fantastic job, and we’ve done a fantastic job together,” Trump said during a cordial Oval Office meeting with Haley before reporters. “She’s a fantastic person, very importantly, but she also is somebody that gets it.”

Haley portrayed her departure as coming at a natural time — after accomplishing what she wanted. Many senior officials were surprised by the announcement and learned she was leaving just minutes before the news leaked — she was already in the West Wing with Trump preparing for the announcement — and lamented that it came so quickly after the confirmation of Justice Brett M. Kavanaugh to the Supreme Court, which the White House hoped would continue to receive heavy news coverage.

“It was a blessing to go into the U.N. with body armor every day and defend America,” Haley said. “And I’ll always do that; I’ll never truly step aside from fighting for our country. But I will tell you that I think it’s time.”

With questions swirling about what she will do next, Haley was quick to shoot down the idea that her ambitions include taking on Trump if the president looks vulnerable heading into his reelection in 2020.

“For all of you that are going to ask about 2020 — no, I’m not running for 2020,” Haley said unprompted with Trump sitting beside her. “I can promise you what I’ll be doing is campaigning for this one. So, I look forward to supporting the president in the next election.”

Trump grinned through her remarks — but they startled White House aides who already viewed her warily as a potential threat and a skeptic of the president’s overall agenda.

“That’s so good, Nikki,” Trump said. “Thank you.”

Haley’s ability to raise the profile of the job of U.N. ambassador has focused more attention on who will replace her than is usually the case.