Nikki Haley has resigned as U.S. ambassador to the United Nations, President Donald Trump confirmed Tuesday, saying she will be leaving the administration "at the end of the year."

Trump said from the Oval Office that Haley told him of her intentions six months ago.

Trump spoke as he and Haley met shortly after word came of her plans to resign.

He called the former South Carolina governor a "very special" person, adding that she told him six months ago that she might want to take some time off. Trump said that together, they had "solved a lot of problems."

It's the latest shake-up in the turbulent Trump administration just weeks before the November midterm election.

She explained the decision as the need for a break without offering any more specific reason.

Haley, who is speculated to hold aspirations for higher office, added pre-emptively:

"For all of you that are going to ask about 2020, no, I am not running for 2020. I can promise you what I'll be doing is campaigning for this one," she said, referring to Trump. "So I look forward to supporting the president in the next election."

"That's so good," Trump said.

Haley, 46, was appointed to the U.N. post in November 2016 and last month coordinated Trump's second trip to the United Nations, including his first time chairing the Security Council.

A rookie to international politics, she was seen as an unusual pick to be U.N. envoy.

"It was a blessing to go into the U.N. every day with body armor," Haley said, saying her job was to defend America on the world stage.

Haley has been a strong advocate of Trump’s foreign policy. On her first day as U.N. ambassador she warned, “For those that don’t have our back, we’re taking names. We will make points to respond to that accordingly.”

After a frosty relationship with Rex Tillerson, Trump’s first secretary of state, she and Tillerson’s successor, Mike Pompeo, often exchanged mutual praise.

She backed Trump’s efforts to cut off funds for the U.N. organization that aids Palestinians and joined in his attacks on Iran. But she also hinted at her disagreements with the president, saying she had a “personal conversation” with Trump about his response to white supremacist violence in Charlottesville, Virginia, last year.

There has been frequent speculation that Haley harbors her own presidential ambitions. She’s repeatedly insisted that she is focused on the job at hand, not future opportunities.

After an anonymous U.S. official published an opinion piece last month declaring that there was an internal resistance to Trump’s policies, Haley wrote one of her own for The Washington Post, declaring her fealty to the president.

"I proudly serve in this administration, and I enthusiastically support most of its decisions and the direction it is taking the country," Haley wrote in her Sept. 7 piece. "But I don't agree with the president on everything. When there is disagreement, there is a right way and a wrong way to address it. I pick up the phone and call him or meet with him in person."

Trump said he intends to have a replacement lined up in "two or three weeks, if not sooner," saying there are "many people who are very much interested in" replacing Haley. "It’s a more glamorous position. It’s a more important position than ever. Nikki Haley has made it a better position."

Material from The Associated Press and Bloomberg was used in this report.