UNITED NATIONS — It was a unique event for the United Nations laced with nostalgia, humor and tributes — the secretary-general and the U.S. president toasting each other for the last time in front of the world’s leaders.

Every year, the U.N. chief hosts a formal lunch for the presidents, prime ministers and potentates attending the annual ministerial meeting of the U.N. General Assembly. And every year, the U.S. president responds as representative of the host country on behalf of the leaders.

But Secretary-General Ban Ki-moon said Tuesday’s lunch was unique.

“Never before have a president of the United States and a secretary-general of the United Nations completed their terms at about the same time — within just 20 days of each other.”

Ban then looked at Barack Obama, sitting just a few feet away at the head table, and said: “Mr. President, we need to find something to do!”

The secretary-general’s second five-year term ends Dec. 31. Obama leaves the White House on Jan. 20 after eight years.

“I challenge you to a round of golf,” said Ban, whose whirlwind globe-trotting schedule doesn’t give him much time to play. “But please don’t challenge me to a game of basketball!”

Obama, a golfer and avid basketball player, didn’t say whether he would take up the secretary-general’s challenge — or what his future plans are.

Neither did Ban, who repeatedly refuses to say whether he will run for president of South Korea, where he was foreign minister before taking the helm of the United Nations.

Obama told the more than 200 VIPs sitting at round tables in the U.N. Delegates Lounge overlooking New York’s East River that they weren’t the only ones grateful for Ban’s leadership.

“A village on the island of Samoa declared him officially a crown chief and prince — which I believe is a title that you can keep for life,” the president said. “There’s no term limit to that.”

On a serious note, Obama paid tribute to U.N. peacekeepers and staff and those who risk their lives delivering aid in Syria, and he praised Ban’s leadership, courage, optimism and imagination. The president proposed a toast expressing gratitude for the secretary-general’s service saying “the world is a better place for him.”

The secretary-general expressed “great appreciation” to Obama for advancing U.N. causes “while upholding our shared values: freedom, equality, democracy and peace.” He then urged the leaders to raise their glasses and toast “to peace, prosperity and human rights across the world.”