President Trump and Chinese President Xi Jinping will meet in Buenos Aires this week to confront perhaps the greatest threat to the weakening global economy — each other.

For the first time since Trump began raising tariffs on Chinese products in July, there is cautious optimism that the two leaders may reach at least a partial deal to defuse a trade conflict that is rattling investors and sapping economic activity around the world.

Domestic political forces — including suddenly wobbly U.S. financial markets and hints of elite disquiet in China — are propelling the two presidents toward a truce.

“The momentum now favors a cease-fire, with a more intense negotiating phase to come after that,” said Michael Pillsbury, director of the Hudson Institute’s Center for Chinese Strategy and an occasional administration adviser.

Any such deal would probably only interrupt rather than reverse a broader deterioration in the relationship between Washington and Beijing. The president’s chief trade negotiator, Robert E. Lighthizer, said in a report last week that despite months of U.S. complaints and tariffs on roughly $250 billion in Chinese imports, China “has not fundamentally altered its unfair, unreasonable, and market-distorting practices,” and both governments appear convinced they will prevail in any enduring confrontation.

The Trump-Xi meeting during the Group of 20 summit comes at a pivotal moment for the global economy, which is slowing as central banks and governments cut back on financial stimulus.

The Paris-based Organization for Economic Cooperation and Development has lowered its growth forecast twice since May as trade tensions have spawned growing investment uncertainty and threatened delicate supply chains.

Global growth is expected to dip to 3.5 percent in 2019 from 3.7 percent this year. Full implementation of all of Trump’s threatened tariffs, along with Chinese retaliation, would cut global growth in 2020 to near its slowest pace since the global financial crisis while shaving about half a percentage point from the U.S. and Chinese rates, according to Laurence Boone, the OECD’s chief economist.

“A soft landing is always difficult to engineer,” Boone said. “Within the current environment, it is especially challenging.”

The presidents’ meeting in Buenos Aires represents “the greatest near-term risk” to the economic outlook, economists at JPMorgan Chase Bank said last week.

Trump often says the United States will prosper with or without a new arrangement with China, while Chinese officials believe the United States will suffer more since it is coming off an economic and stock market peak, said Mei Xinyu, a researcher at a Chinese Ministry of Commerce think tank.

China already has begun adjusting to slowing growth and will wait out Trump, who is up for reelection in two years, rather than be “humiliated” by a foreign adversary, Mei said.

“China is falling out a second-story window and spraining its ankle; the U.S. is falling off the top of the World Trade Center,” he said. “The effects for each country will be different, and I think China is better able to take suffering.”

For much of the past year, Chinese leaders had not believed that the Trump administration was serious about confrontation, with officials including Vice President Wang Qishan telling foreign visitors that Trump might ease off after the midterms, said a former U.S. government official who met with Wang and asked for anonymity to discuss confidential discussions.

But a resigned pessimism has emerged in Beijing, where there is serious talk of a new cold war following Vice President Pence’s sweeping condemnation of China at the Hudson Institute in Washington in October.

Another fiery Pence address at an Asian summit last month in Papua New Guinea — where he briefly met Xi — reinforced Chinese concerns that Washington is demanding fundamental changes in China’s economic model that Beijing regards as nonnegotiable.

That gap is muting expectations for the Trump-Xi meeting.

“If anything comes of it, it’s probably a false dawn or short-term truce,” said Adam Posen, president of the Peterson Institute for International Economics.

No one expects an accord that resolves all disputes in the U.S.-China relationship. In recent months, the United States has stepped up its complaints about a range of Chinese practices — including a military buildup in the South China Sea and Beijing’s treatment of Muslims in Xinjiang province — that go well beyond trade.

The most likely deal would involve Trump holding off on further tariff increases in return for Xi lifting retaliatory tariffs on American products such as soybeans and liquefied natural gas, according to several analysts.

When Trump and Xi meet, U.S. officials want the Chinese to provide “evidence of seriousness” and “concrete responses” to administration complaints, said a senior administration official who agreed to preview the talks if granted anonymity.

“The ball is very much in China’s court,” the official said.

Investors would welcome a Trump decision to freeze existing tariffs, which are scheduled to increase on Jan. 1 to 25 percent from 10 percent. Trump also has threatened to impose additional levies on the remaining $257 billion in Chinese products entering the United States.

There is widespread support within the administration for halting Trump’s tariff threats, according to Derek Scissors, a China expert at the American Enterprise Institute who follows internal deliberations.

“They do not want to escalate to 25 percent on January 1,” Scissors said.

There is precedent for Trump holding his fire. In July, after repeatedly threatening to impose tariffs on automobiles imported from the European Union, Trump met with European Commission President Jean-Claude Juncker and agreed to effectively pause as long as trade talks continued.

Many analysts expect a similar outcome from the Trump-Xi meeting, with the two leaders launching a new negotiation under cabinet-level officials, perhaps with a short-term deadline for achieving results, Pillsbury said.

But such an agreement would not affect the administration’s other plans to get tough on China. The administration supported legislation this year that tightened the government review process for proposed Chinese investments in the United States, is prosecuting more Chinese hackers tied to cyberattacks and last week launched a Commerce Department effort to limit exports of critical technologies such as artificial intelligence and robotics.

“Even if the meeting in Buenos Aires succeeds in calling a halt in the tariff war, these other trends will go forward,” said Dan Price, who is managing director for Rock Creek Global Advisors and coordinated international economic policy for President George W. Bush.

Trump will arrive at the G-20 after one of the rockiest periods of his presidency. The midterm elections delivered the Democratic Party control of the House. His trip to Paris for a World War I commemoration was widely panned after he chose not to visit a military cemetery in the rain, and his decision to side with Saudi Arabia in the fallout from the killing of Washington Post contributing columnist Jamal Khashoggi has drawn bipartisan criticism.

U.S. financial markets, which Trump often cites as validation of his policies, have sunk in recent weeks. Since hitting an all-time high on Oct. 3, the Dow Jones industrial average has lost nearly 9 percent and turned negative for the year.

The markets’ struggles coincided with a shift in the president’s tone on China. After saying for weeks that the time was not right for a deal, Trump has begun setting the stage for a positive outcome.

“We’re doing very well with China,” he told reporters last week. “China wants to make a deal very badly. They might not say that to you, but they want to make it very badly.”

Xi has his own reasons to compromise. The trade war is complicating Chinese efforts to wean its companies from excessive reliance on cheap credit. Even its oft-doubted official statistics show the economy slowing to a 6.5 percent annual growth rate in the third quarter, its weakest since the depths of the financial crisis.

“China is quite weak,” said Robin Brooks, chief economist for the Institute of International Finance. “Our own data has it at 5 percent and slowing very sharply.”

The rapid slowdown has put “huge internal pressure” on Beijing, said Yu Yongding, a prominent economist at the Chinese Academy of Social Sciences in Beijing. For Chinese leaders, even a temporary truce could boost domestic financial markets that have fallen by a fifth this year despite government stimulus.

As the impasse with the United States has deepened, there have been signs that some Chinese elites fear that Xi, an assertive nationalist, may have overreached.

In October, Deng Pufang, the son of former Chinese leader Deng Xiaoping, said in a private speech that the government should “keep a sober mind and know our own place,” the South China Morning Post reported.

“There is the danger that if the trade relations between China and the United States is disrupted — causing many closures of factories in China, dismissals of labor forces in a massive way in China — all these negative developments may add up to cause instability in China,” said Victor Gao, a former interpreter for Deng Xiaoping, the architect of China’s economic modernization. “. . . A trade war is the worst enemy of normal economic development, either here for China or over there in the United States.”

Shih reported from Hong Kong. Luna Lin in Beijing contributed to this report.