The compromise, struck over a steak dinner at the Group of 20 meeting here and announced in a White House statement, was less a breakthrough than a breakdown averted.

The two leaders remain far apart on basic issues of market access and trade policy, and there was no sign that either planned to back down on those.

Still, the handshake deal between Trump and Xi, after what the White House called a “highly successful meeting,” pauses what was becoming a headlong race toward economic conflict. It will reassure jittery financial markets, as well as American farmers, who worried about the fallout from a prolonged trade battle.

In a significant concession, Trump will postpone a plan to raise tariffs on $200 billion worth of Chinese goods to 25 percent, from 10 percent, on Jan. 1. The Chinese agreed to an unspecified increase in their purchases of American industrial, energy and agricultural products, which Beijing hit with retaliatory tariffs after Trump targeted everything from steel to consumer electronics.

The countries set an ambitious deadline of 90 days to reach a broader trade agreement, with the White House warning that if they did not come to terms by then, Trump would raise the existing tariff rate to 25 percent.

“The relationship is very special — the relationship that I have with President Xi,” Trump told reporters, as he sat across a long table from the Chinese leader before dinner was served. “I think that is going to be a very primary reason why we’ll probably end up with getting something that will be good for China and good for the United States.”

Xi replied, “Only with cooperation between us can we serve the interest of world peace and prosperity.”

As the dinner ended, the Chinese and U.S. officials applauded the two leaders.

For Trump, the agreement was an upbeat end to his subdued visit to the G20 meeting. He dodged unsavory friends, smiled through chilly encounters with allies, and canceled a news conference out of respect for his predecessor, George H.W. Bush, whose death Friday was a reminder of the role U.S. presidents once played at these gatherings.

On his second day in Buenos Aires, Trump said little about global security or diplomacy, keeping a single-minded focus on trade. That put leaders like Chancellor Angela Merkel of Germany in an awkward position, because Germany, as a member of the European Union, cannot negotiate by itself with the United States on trade issues.

“We have a tremendous trade imbalance, but we’re going to get that straightened out,” he said before meeting Merkel on Saturday morning. “We all understand each other.”

U.S. and Chinese officials conducted quiet talks about a compromise over the last several weeks. But the outcome remained in doubt until the end, when Trump, flanked by his top aides, sat down with Xi and his aides to a meal of grilled sirloin and bottles of Malbec.

Trump had veered from optimism to wariness about a deal, sometimes in the course of a single statement. His economic team offered sharply conflicting advice, with moderates like Treasury Secretary Steven Mnuchin counseling compromise, while hard-liners like Peter Navarro, the White House director of trade, urged him to double down on his pressure.

The moderates tried to exclude Navarro from the trip. But at the dinner in a Buenos Aires hotel, he was there at the table, seated between the national security adviser, John R. Bolton, and the chief of staff, John Kelly. He leaned forward to listen to the president as he urged Xi to crack down on illicit shipments of the deadly opioid, fentanyl.

The White House said Xi, in a “humanitarian gesture,” had agreed to designate fentanyl as a controlled substance.

China was quick to portray the agreement as a concession by Trump. Wang Shouwen, the vice commerce minister, said the president had agreed to revoke his plan to raise tariffs on certain Chinese goods to 25 percent, according to Reuters.

The Chinese foreign minister, Wang Yi, said, “China is willing to expand imports according to the needs of the domestic market and the people,” which he said would “gradually ease the problem of trade imbalance.”

Of the roughly $250 billion worth of Chinese goods targeted by tariffs, $50 billion is already taxed at 25 percent, while the remaining $200 billion is taxed at 10 percent. As part of a series of tit-for-tat moves, Trump said he would raise the tariff for all goods to 25 percent and consider imposing tariffs on an additional $267 billion worth of exports.

Some experts said the forces Trump had set in motion with Beijing would be hard to restrain. The United States is demanding sweeping changes in China’s trade policy, which the Communist government might find politically difficult to enact and impossible to enforce.

And the 90-day deadline is exceptionally ambitious for a trade agreement that has eluded negotiators for nearly two years.

“A halt in the tariff wars will be welcome but won’t alter the fundamental collision course that Trump and Xi seem to be on,” said Daniel M. Price, a former trade adviser to President George W. Bush.

The White House, he said, continued to tighten export controls and to bar Chinese high-technology firms like Huawei from U.S. infrastructure projects. It is also lining up other countries to clamp down on the forced transfer of technology to China — all steps that will provoke Beijing.

Still, Trump was a less disruptive presence at this gathering than he has been at previous ones. The G20 members agreed on a 31-point communiqué that reaffirmed their commitment to the Paris climate accord, even as the United States reiterated its decision to pull out of it.

“All countries except the U.S. backed conclusions reaffirming the Paris Agreement and its full implementation,” Laurence Tubiana, the former French climate negotiator and now head of the European Climate Foundation, said in a statement.

The statement also expressed concern that the World Trade Organization should be reformed. The WTO is a favorite target of Trump because he believes it crimps America’s ability to use tariffs and allows countries like China to cheat.

“The system is currently falling short of its objectives and there is room for improvement,” the communiqué said, in a phrase that an administration official described as a victory for Trump.

The statement did not include a reference to the dangers of protectionism, which U.S. officials said could have held it up. Two weeks ago, a feud over language on trade between China and the United States stymied the drafting of a communiqué after an economic summit in Papua New Guinea — and it was never issued.

By contrast, this meeting was relatively harmonious, with Bush’s death eliciting expressions of condolence from Merkel and Xi, who praised his role in advancing American-Chinese relations. In 1974 and 1975, Bush headed the U.S. liaison office to the People’s Republic of China, a forerunner of the U.S. Embassy.

By canceling his news conference, Trump avoided a platform where his freewheeling and provocative remarks could have emphasized differences with allies and adversaries alike. Instead, he struck a somber tone, praising Bush and his legacy in all his meetings.

“The fact that we lost a president who truly was a wonderful person, a wonderful man, a great man — it really puts a damper on it, to be honest with you,” Trump said, as he sat next to Merkel.

He invited the chancellor to share a recollection of a visit she made to the White House with then-Chancellor Helmut Kohl, when Mr. Bush was still president. She referred to him as “one of the fathers of the German unification,” adding, “we will never forget that.”

Even before Bush’s death, the meeting was shadowed by Trump’s legal troubles back home — his former personal lawyer, Michael D. Cohen, pleaded guilty to lying to Congress about his dealings with Russia on behalf of Trump — and by his truncated schedule in Buenos Aires.

This was the kind of diplomatic conclave at which Bush, a globe-trotting foreign-policy president, would have thrived. But Trump’s experience was less comfortable.

He skipped meetings with President Vladimir Putin of Russia and Crown Prince Mohammed bin Salman of Saudi Arabia, two strongmen he has drawn close but who have fallen into disrepute.

Putin has come under criticism for a clash last week between Russian and Ukrainian naval vessels, while the CIA concluded that Crown Prince Mohammed played a role in the killing of Saudi dissident Jamal Khashoggi in the Saudi Consulate in Istanbul in October.

Trump’s stubborn defense of Crown Prince Mohammed has aggravated tensions with Turkey, which shared an audio recording of the attack on Khashoggi with the director of the CIA, Gina Haspel, and demanded a fuller accounting from the Saudis of what happened.

On Saturday, Trump met with Turkey’s leader, Recep Tayyip Erdogan, but the White House closed the session to even the brief picture-taking opportunity that usually accompanies these meetings.

At a dinner for the leaders Friday night, the White House said Trump spoke informally with Putin. There were photos of the president and first lady Melania Trump seated at the long table, separated from Putin by Xi and his wife, Peng Liyuan.

This article originally appeared in The New York Times.

Mark Landler © 2018 The New York Times