DAVOS, Switzerland — In a world troubled by grave uncertainties over the basics governing trade, security and the mission to limit climate change, President Xi Jinping of China on Tuesday portrayed his nation as a responsible global citizen dedicated to furthering international integration.

That a leader of the People’s Republic of China can stake a claim to the mantle of leadership in the realm of free trade speaks to the unforeseen, even surreal alteration of the global order in recent months.

His message, delivered here in the Swiss Alps at the annual gathering of the World Economic Forum, appeared meticulously timed to the tumultuous moment at hand. He was speaking three days before Donald J. Trump was to be inaugurated president of the United States, raising the prospect of a trade war with China, and on the same day that Prime Minister Theresa May of Britain outlined plans to pursue her country’s departure from the European Union.

The Chinese leader used his moment to make an expansive case for globalization as a source of prosperity. He never mentioned Mr. Trump by name, nor did he even make reference to the fact that the White House is about to gain a new occupant. Yet his speech resonated as a rebuke of the trajectory that the president-elect has promised — not least, his repeated threat of steep tariffs on Chinese goods as a response to what he portrays as predatory trade practices.

“Pursuing protectionism is just like locking oneself in a dark room,” the Chinese president declared. “While wind and rain may be kept outside, so are light and air. No one will emerge as a winner in a trade war.”

In myriad ways, Mr. Xi is a strikingly ill-fitting steward of openness and connectivity.