When Gov. Jerry Brown flew across the Pacific four years ago to meet with leaders and business executives in China, the world seemed much different.

President Obama had committed to fight the warming of the planet, while China remained a reluctant actor yet to take a firm stand. On Friday, when the seasoned California governor heads back to China for a series of business and government meetings, the political roles will have reversed.

Now, it’s China that is poised for global leadership. And as President Trump retreats from the nation’s previous path on environmental policy, Brown has the distinction of being America’s unofficial ambassador on climate change.

“Trump is going against science. He’s going against reality,” Brown said in an interview with The Times on Wednesday. “We can’t stand by and give aid and comfort to that. We have to do what’s right.”

Trump’s victory and his administration’s focus on rolling back environmental regulations have left Brown to serve as a political and policy counterweight.

“We want to further strengthen our relationship with China,” the governor told The Times. “The world is moving in a direction that I want California to be a part of.”

The trip begins just one day after Trump announced that the U.S. will withdraw from the Paris accord on climate change. It was an action to which the Democratic governor quickly reacted, calling it “insane” and “deviant behavior.” Brown will now try to demonstrate to the Chinese — and by extension, other world leaders — that some parts of the country are still moving forward.

"We traditionally point to Washington as propagating foreign policy. But when Washington leaves the scene on important topics like climate change, others fill in,” said David Victor, a professor of international relations at UC San Diego. “California gains a much more central role in shaping the U.S. relationship with the rest of the world."

While the timing of the trip seems serendipitous considering national events, it presents problems for the governor back at home. Lawmakers are less than two weeks away from passing a new California state budget, and Brown’s decision to skip some of the negotiations is a notable break with precedent. His administration is also enmeshed in efforts to extend the life span of California’s landmark cap-and-trade program, which requires companies to buy permits to release greenhouse gas emissions.

Nonetheless, he departs on Friday for a weeklong trip with high-ranking members of his administration and business leaders organized by the Bay Area Council, a San Francisco-based advocacy group. He’s scheduled to meet with provincial officials in cities with reputations for progressive views on the environment and an interest in green technology, before traveling to Beijing for an international clean energy summit.

When Brown visited in 2013 with a delegation of nearly 100 business officials, President Xi Jinping had just assumed power. The governor rode the country’s sleek high-speed rail, opened a trade office in Shanghai and promoted California’s clean-energy companies.

He also laid the groundwork for a climate-change agreement with national officials to promote clean energy and efforts to combat air pollution in a year when Chinese cities disappeared under a layer of soupy gray smog and children regularly ended up in the hospital gasping for breath. China, just months earlier, had finally started publishing air quality measurements.

On his return to China, Brown will find a country that has become the world’s biggest investor in renewable energy. Officials plan to launch a cap-and-trade system for carbon dioxide emissions this year, much like California’s program. And they’re considering rules modeled off the Golden State that would encourage electronic vehicle production.

Last November, California agreed to serve as a technical advisor to about 100 Chinese cities that aim to reduce their carbon emissions ahead of a 2030 deadline.

"China has always looked to California," said Sophie Lu, a Beijing-based China research head for Bloomberg New Energy Finance, which analyzes energy markets. "It’s definitely a role model."

Even with its marked progress, though, the nation still ranks as the world’s largest emitter of greenhouse gases and the biggest funder of new coal power projects. Beijing winters look like someone tossed a dirty rug over the sky.

But Xi now peppers speeches with calls for environmental stewardship, and is pushing countries to back the climate pact China negotiated with the Obama administration. Xi instructed senior officials last week to help protect the environment "like one protects his eyes," according to the official Xinhua News Agency.

Brown will spend the first two days of his trip in the southern Chinese cities of Chengdu and Nanjing reinforcing the kind of regional relationships in which states generally have the greatest influence. In Beijing, he’ll attend a forum on clean energy and discuss climate policy at an annual gathering of energy ministers — including Energy Secretary Rick Perry, the oil-friendly former Texas governor who tangled with Brown for years over California’s overall business climate.

"China’s been learning that the U.S. is not like China where you have a central government, and local governments do anything the central government directs them to do," said Xu Yuan, a climate change expert and professor at the Chinese University of Hong Kong. "The U.S. is entirely different and China appreciates that more."

Even as Trump promises to shrink the role of the federal government on climate efforts, some analysts still question whether a state can step into a spot reserved for nations, or if it’s limited to more incremental regional deals.