Outgoing United Nations ambassador Nikki Haley got some laughs Thursday night at the annual Alfred E. Smith Memorial Foundation Dinner by mentioning some advice given to her by President Donald Trump in the event the room went cold.

"He said if I get stuck for laughs, just brag about his accomplishments — it really killed at the U.N., I gotta tell you," Haley joked.

Haley, who announced last week that she will leave her post as as ambassador to the United Nations at the end of the year, joked about "sanctuary cities" that reject cooperation with federal law enforcement efforts to round up undocumented immigrants.

She said she got Democratic New York City Mayor Bill de Blasio's drink by mistake, raising a glass of water with "no ice," referring to Immigration and Customs Enforcement.

As a member of Trump's cabinet, Haley said "it is a thrill to be out to dinner without being harassed."

But amid the jokes, Haley struck a serious tone and called for greater civility in an America that seems to be riven by harsh and unyielding rhetoric, which she said is coming from both sides of the political divide. At a rally in Montana Thursday evening, Trump praised a congressman who body-slammed a reporter.

"In our toxic political environment, I've heard some people in both parties describe their opponents as enemies or evil," Haley said. "In America, our political opponents are not evil."

"In South Sudan, where rape is routinely used as a weapon of war — that is evil. In Syria, where the dictator uses chemical weapons to murder innocent children — that is evil,” she said. “In North Korea, where American student Otto Warmbier was tortured to death — that was evil.

"In the last two years, I've seen true evil," she continued. "We have some serious political differences here at home. But our opponents are not evil. They're just our opponents."

Haley also referenced the sex abuse scandal rocking the Catholic Church, and said the devastating effects on the victims is compounded by the perpetrators being in positions of faith and trust.

"The church's place must be with the victims that carry the pain with them," she said. "I know the church leaders recognize its deep responsibility to address this moral failing, and it is taking action."

Haley was tapped by Trump to serve as U.N. ambassador in 2016 and said Thursday she was grateful for the opportunity and she learned a lot.

"I learned that the U.N. has 193 member nations ... 180 of which are mad at us on any given day."

"And the most important thing I learned is that with all of our differences, there is still one thing that unites all 193 countries — at one point, every single one of them was paying Paul Manafort," she joked.

Haley, the child of immigrants from India, also joked about Sen. Elizabeth Warren's recent DNA test intended to prove her Native American ancestry.

"Actually, when the president found out that I was Indian-American, he asked me if I was from the same tribe as Elizabeth Warren," Haley said.

Comedian Jim Gaffigan, the master of ceremonies, introduced Haley as "the next president of the United States." But she dismissed speculation that she might consider running for president.

"That is so ridiculous," Haley said. "It is way too early for anyone to be thinking about running for president — unless you’re a Senate Democrat during the Kavanaugh hearings."

There were some groans, then applause.

Turning to the last election, Haley took some jabs at Democrats by using Bob Woodward's book "Fear."

"The president got really mad at Bob Woodward's book. Really mad. The book compared him to a fifth-grader," she said. "A lot of Democrats seized on that — until they realized they got beat by a fifth-grader."