US President Donald Trump has accepted the resignation of UN Ambassador Nikki Haley.
He told reporters in the Oval Office that she would be leaving the post at the end of the year after doing "an incredible job".
Joined by the former South Carolina governor in the Oval Office, he invited her to come back in a different role. "You can have your pick," he said.
Mrs Haley was confirmed as US envoy to the UN in January 2017.
The White House revolving door
Mr Trump said Mrs Haley had told him six months ago she wanted to take some time off.
She told reporters that despite speculation, she was not planning to run for president in 2020 and would be campaigning for Mr Trump, who has already announced his re-election bid.
"Thank you, Mr President. It has been an honor of a lifetime," she said along Mr Trump.
The president said Mrs Haley "has been very special to me, she has done an incredible job, she is a fantastic person, very importantly, but she is also somebody that gets it."
"We've done a fantastic job together," he continued. "We've solved a lot of problems, and we're in the process of solving a lot of problems."
"Hopefully you'll be coming back at some point, right," Mr Trump said. "Maybe a different capacity, you can have your pick." Mrs Haley laughed.
Mr Trump added that he would be naming her replacement in the next two to three weeks.
"She's made it a very glamorous position, more importantly, a more important position.
Who is Nikki Haley?
Nikki Haley, born Nimrata Randhawa to Indian immigrant parents, was raised as a Sikh in Bamberg, South Carolina, later converting to Christianity
Her first job as a 13-year-old was bookkeeping for her family's clothing store
In 2010, she became South Carolina's first female and first minority governor - and the youngest governor in the country. She was re-elected to the post in 2014, serving until she joined the Trump cabinet in 2016
Mrs Haley gained national prominence for her response to a mass shooting in June 2015 at a predominately African-American church in Charleston, South Carolina when she removed the Confederate flag from the state capitol grounds, receiving praise from both sides of the aisle
Before becoming the US envoy, Mrs Haley had little foreign policy experience, though she did travel abroad as governor to broker economic deals for South Carolina
While she historically did back Mr Trump, she did not endorse him during the 2016 presidential campaign, instead backing Florida Senator Marco Rubio
Mrs Haley is married to Army National Guard Captain Michael Haley, and the couple have two teenage children
Her exit comes after she served as the temporary president of the UN Security Council for one month.
Mrs Haley's Twitter bio has already removed all references to her role as UN ambassador.
In April, she clashed with the White House when a Trump aide suggested she had prematurely announced a new round of sanctions against Russia.
The Republican woman who took on Trump
White House economic adviser Larry Kudlow told reporters Mrs Haley had gotten "ahead of the curve" by previewing the policy, putting her notes down to "momentary confusion".
She fired back hours later telling Fox News: "With all due respect, I do not get confused."
The daughter of immigrants from India, Mrs Haley was a frequent and early critic of Mr Trump during his election campaign while she served as the Republican governor of South Carolina.
In December 2017, she said that the women who had accused Mr Trump of sexual assault "should be heard".
At one point she suggested that Mr Trump's rhetorical could trigger a world war.
BBC New York correspondent Nick Bryant said she had formed a partnership with UN General Secretary Antonio Guterres to protect the UN against Mr Trump's anti-globalist agenda.
Her with-us-or-against-us approach grated on many diplomats in the chamber but she was broadly considered to be an internationalist ally, our correspondent adds.
Republican lawmakers swiftly praised Mrs Haley after the news broke.
Retiring Speaker of the House Paul Ryan said she "has been a clear, consistent, and powerful voice for America's interests and democratic principals on the world stage".
"She challenged friend and foe to be better," he added.
South Carolina Senator Lindsey Graham said she had been "a true agent of