BEIJING — The comment was made behind closed doors, and appeared to be in jest: President Trump told donors on Saturday that China’s president, Xi Jinping, was now “president for life,” and added: “I think it’s great. Maybe we’ll want to give that a shot someday.”

The remarks, confirmed by a leading Republican lobbyist who attended the luncheon at Mr. Trump’s Mar-a-Lago estate in Florida, were first aired by CNN, which obtained an audio recording of his comments.

The statement, which drew laughter from those in attendance and was said by a smiling president, according to the lobbyist, was given on a day when Mr. Trump was out for laughs. On Saturday evening, at the annual Gridiron dinner in Washington, Mr. Trump jokingly said of possible talks with the North Korean leader, Kim Jong-un: “As far as the risk of dealing with a madman is concerned, that’s his problem, not mine.”

Nonetheless, the remarks appeared to be the first comments made by Mr. Trump about China’s decision to scuttle the two terms for its presidency — part of a remarkable consolidation of power around Mr. Xi — and Chinese analysts took them seriously.