US President Donald Trump has accepted the resignation of his UN ambassador Nikki Haley.

Ms Haley is resigning later this year in the latest shake-up to Mr Trump’s turbulent administration.

Ms Haley hinted in her resignation letter to Mr Trump that she is seeking a job in the private sector and ruled herself out of running for president in 2020.

“I have given everything I’ve got these last eight years,” she said, referring to her six years as South Carolina governor as well as her time at the UN.

“And I do think it’s good to rotate in other people who can put that same energy and power into it.”

There has been speculation that Ms Haley, the former governor of South Carolina, will return to government or politics at some point.

“No, I’m not running in 2020” for president, she joked, quickly adding that she would be supporting Mr Trump.

Ms Haley has two children to put through university and the potential to make much more money in the business world.

The decision to announce the latest shake-up came less than a month before the congressional elections, even as the White House has made a concerted effort to hold off on major changes — at the Justice Department and elsewhere — before then.

Mr Trump was asked why the announcement was made now since Ms Haley is staying until the end of the year.

Instead of answering directly, he recounted how she has had to work on tough issues, such as Iran and North Korea.

White House officials had sought to put a hold on record-setting administration turnover in the run-up to the November 6 elections, with aides being asked months ago to step down or commit to stay to election day to avoid adding to a sense of turmoil.

Mr Trump said Ms Haley first discussed leaving the administration with him six months ago.

Donald Trump with Nikki Haley in the Oval Office
Donald Trump with Nikki Haley in the Oval Office (Evan Vucci/AP)

More recently, there was an awkward moment at the UN, when Mr Trump’s boasting of American economic strength under his leadership drew laughter at a General Assembly session. He insisted later that the delegates were laughing with him, not at him.

The six-month timeline also coincides with a high-profile spat between Ms Haley and the White House in April, when she drew the president’s ire for previewing in a television appearance the administration’s planned imposition of a new round of sanctions on Russia.

When the sanctions never materialised, White House officials said the plans had changed without Ms Haley being briefed, and top economic adviser Larry Kudlow suggested Ms Haley was confused.

“I don’t get confused,” Ms Haley said in a sharply-worded rejoinder to the West Wing.