BEIJING — Gov. Jerry Brown of California should be fading quietly into the final days of his career. After 40 years in public life, Mr. Brown, 79, a Democrat, is in the final stretch as the state’s chief executive. He has been talking about the Colusa County family ranch where he wants to retire. And a battery of younger politicians is already battling to succeed him.

But instead, Mr. Brown was in China on Tuesday, emerging as a de facto envoy from the United States on climate change at a time when President Trump has renounced efforts to battle global emissions. In a meeting packed with symbolism — and one that seemed at once to elevate the California governor and rebuke Mr. Trump — President Xi Jinping of China met with Mr. Brown, at the governor’s request, at the very moment China prepares to take a more commanding role in fighting climate change.

“California’s leading, China’s leading,” Mr. Brown said at a wide-ranging and at times feisty news conference after he met with Mr. Xi. “It’s true I didn’t come to Washington, I came to Beijing. Well, someday I’m going to go to Washington, but not this week.”

Mr. Brown has long used his platform as governor to advocate emission reduction policies, both in his state and globally. But the decision by Mr. Trump to withdraw from the Paris climate agreement, on the eve of Mr. Brown’s trip here, gave an already planned visit new visibility.