U.S. President Donald Trump accepted Tuesday the resignation of his ambassador to the UN.

Nikki Haley and Trump made the official announcement in a rare Oval Office address in which Haley said she would depart the Trump administration at year's end. 

Explaining her decision to exit her UN post Haley said, "I'm a believer in term limits." 

"I think you have to be selfless enough to know when you step aside and allow someone else to do the job," she said. "It's been an honor of a lifetime."

She denied speculation she would run in the 2020 presidential election, potentially against the Republican president, and said she would instead be campaigning for Trump. 

Haley oversaw the president's diplomatic efforts at the UN, particularly his calls for reform of the international body and international drive to apply pressure on North Korea.

But she was not without her differences with Trump. 

She acknowledged in a Washington Post op-ed in September that "I don’t agree with the president on everything."

"If I disagree with something and believe it is important enough to raise with the president, I do it. And he listens. Sometimes he changes course, sometimes he doesn’t," she said in the piece that addressed concerns about who in the administration was trying to undermine the president following an anonymous New York Times op-ed. 

Trump said he would nominate a replacement within the coming weeks, but lauded her work as "fantastic." 

Haley's resignation comes one day after a government watchdog called for an investigation into Haley after she and her husband accepted flights on private aircraft, but the Citizens for Responsibility and Ethics in Washington acknowledged "these two things are probably unrelated."

The group sent a letter Monday to the State Department's Inspector General requesting it probe seven free flights the ambassador and her husband took, estimating they cost tens of thousands of dollars. 

Haley said in financial disclosure forms the flights were from three South Carolina businessmen with whom she was close friends, according to the watchdog. 

Haley was South Carolina's governor from 2011 to 2017 when she took her UN post.