It's the latest shake-up in the turbulent Trump administration just weeks before the November midterm elections. Haley's resignation was a closely guarded secret. Congressional Republicans involved in foreign policy matters and some key US allies did not get advance word from Haley or the White House.
Haley, 46, was appointed to the UN 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, the former South Carolina governor was an unusual pick for to be UN envoy.
"It was a blessing to go into the UN every day with body armour," Haley said, saying her job was to defend America on the world stage.
At the UN, Haley helped spearhead the Trump administration's efforts to combat what it alleged to be anti-American and anti-Israel actions by the international body.
Trump said he was considering many candidates for Haley's job and that a successor would be named in two to three weeks.
Last month Haley wrote an op-ed article in the Washington Post discussing her policy disagreements but also her pride in working for Trump. It came in response to an anonymous essay in the New York Times by a senior administration official that alleged there to be a secret "resistance" effort from the right in Trump's administration and that there were internal discussions of invoking the 25th amendment to remove him from office.
"I proudly serve in this administration, and I enthusiastically support most of its decisions and the direction it is taking the country," Haley wrote. "But I don't agree with the president on everything."
The daughter of Indian immigrants, Haley clashed with then-candidate Trump during the 2016 campaign, denouncing "the siren call of the angriest voices" who disrespected America's immigrants. Trump tweeted that "The people of South Carolina are embarrassed by Nikki Haley."
"Before she was named by Trump to her UN post, Haley was elected the first female governor of South Carolina. She was re-elected in 2014.
South Carolina Republican Senator Lindsey Graham, a close Trump ally tweeted that Haley "has a very bright future and will be a key player in both the future of the Republican Party and our nation as a whole for years to come".
As governor, she developed a national reputation as a racial conciliator who led the charge to bring down the Confederate flag at the Statehouse and helped guide the state through one of its darkest moments, the massacre at a black church.
- AP