WASHINGTON – President Donald Trump's ambassador to the United Nations, Nikki Haley, said Tuesday she will step down at the end of the year, an unexpected departure as the administration makes fundamental changes to U.S. policy abroad.

Haley, a former South Carolina governor who became one of the most prominent women in Trump's Cabinet, helped the president embrace a more isolationist approach while delivering a steady message when White House policy was unclear.

The move, less than a month before the midterm elections, set off rampant speculation about who would fill the Senate-confirmed position. Trump dismissed the idea of appointing his daughter Ivanka and confirmed he would consider Dina Powell, a former deputy national security adviser.

Initially a critic of Trump, Haley maintained high standing in the administration despite occasional disagreements with the president that spilled into public view. She is a potential candidate for higher office – including for president – an idea she downplayed during a meeting with Trump at the White House.

"She’s done a fantastic job, and we’ve done a fantastic job together," Trump said. "We’ve solved a lot of problems."

The daughter of immigrants from India, Haley was a South Carolina legislator who rode a wave of Tea Party movement support to win the governor's race in 2010.

She won re-election in 2014 but cut her second term short to join Trump's diplomatic team. Republicans in South Carolina, a key state for Trump in the 2016 GOP primaries, urged Trump to recruit Haley, who was also discussed for the secretary of state slot.

Although she's one of Trump's longest-serving aides, there has been friction between the two.

In April, White House aides criticized Haley for getting ahead of the administration in announcing Russia sanctions. Haley bristled at top economic adviser Larry Kudlow's suggestion that the U.N. ambassador had "momentary confusion" over the issue.

"With all due respect, I don't get confused," Haley replied in a statement.

The U.N. ambassador said she had a "personal conversation" with Trump after he suggested both sides were responsible for violence that broke out at a white nationalist demonstration last year in Charlottesville, Virginia. A counterdemonstrator was killed by a car driven by a man who had expressed neo-Nazi beliefs.

During her years as governor, Haley led the effort to remove the Confederate battle flag from the Statehouse.

Brett Bruen, who served as global engagement director in President Barack Obama's administration, said Haley’s resignation was a “significant blow” to Trump's ability to execute foreign policy. He said U.N. ambassadors normally stay for a full term, in part because it takes time to build the relationships and trust needed to be successful.

“At the U.N., it’s not a situation where you get to parachute in and affect immediate change,” Bruen said. “For her to walk away halfway through that process leaves the United States vulnerable at a very serious time.”

Trump said the search for a replacement would begin immediately, but his daughter wouldn't be in the running because he didn't want senators reviewing her nomination to be able to level charges of nepotism.

Ivanka Trump is a White House adviser, a job that does not require confirmation.

Aboard Air Force One late Tuesday, Trump said he had five candidates, including Powell, on a "short list" for the job. He said Richard Grenell, the U.S. ambassador to Germany, is not on the list, but he is willing to consider him.

Haley rejected talk of her own presidential campaign and said she intends to support Trump for re-election.

“No. I am not running in 2020," she said.

Haley described her legacy as helping to change the way the United States is viewed in the world. Trump followed through on campaign promises to take more hard-line stances on global trade, the Paris climate accord and the Iran nuclear agreement.

"Now, the United States is respected," Haley said, repeating a point Trump often makes on the campaign trail. "Countries may not like what we do, but they respect what we do. They know that if we say we’re going to do something, we follow it through."

More:Nikki Haley: World leaders laughed at Trump because they love his honesty

More:Nikki Haley's resignation will mean there are 5 women left in President Trump's Cabinet

More:Trump's tough line on Iran could rankle world leaders at UN General Assembly

More:Senate confirms Trump nominee Nikki Haley for UN ambassador