Osaka, Japan — In a move that will certainly thaw the ongoing trade war between the United States and China, President Trump and China's Xi Jinping agreed to restart trade talks on Saturday at the G20 conference, averting an escalation feared by financial markets, businesses and farmers. "We're going to work with China where we left off," Trump said.

Mr. Trump said existing U.S. tariffs would remain in place against Chinese imports while negotiations continue, but additional tariffs he's threatened to slap on other Chinese goods will not go forward for the "time being."

Mr. Trump spoke after a lengthy meeting with Xi on the margins of the Group of 20 summit in Osaka. The U.S. president pronounced relations with China "right back on track," but doubts persist about the two nations' willingness to compromise on a long-term solution.

Get Breaking News Delivered to Your Inbox

The apparent truce continues a pattern for talks between Mr. Trump and Xi, who have more than once professed their friendship and hit pause on protectionist measures, only to see negotiations later break down over contentious details.

Eleven rounds of talks have so far failed to end the standoff. The U.S. has imposed 25% import taxes on $250 billion in Chinese products and is threatening to target another $300 billion — a move that would extend the tariffs to virtually everything China ships to the U.S.

China has lashed back with tariffs on $110 billion in American goods, focusing on agricultural products in a direct and painful shot at Mr. Trump supporters in the U.S. farm belt.

Saturday's meeting between the two leaders was the centerpiece of four days of diplomacy in Asia for Mr. Trump, whose re-election chances have been put at risk by the trade war that has hurt American farmers and battered global markets. Tensions rose after negotiations collapsed last month.

Mr. Trump said the talks with Xi went "probably even better than expected."

Seated across a lengthy table flanked by top aides, both leaders struck a cautiously optimistic tone after they posed for photographs.

"We've had an excellent relationship," Mr. Trump told Xi as the meeting opened, "but we want to do something that will even it up with respect to trade."

Xi, for his part, recounted the era of "ping-pong diplomacy" that helped jump-start U.S.-China relations two generations ago. Since then, he said, "one basic fact remains unchanged: China and the United States both benefit from cooperation and lose in confrontation."

"Cooperation and dialogue are better than friction and confrontation," he added.

China and the U.S. are sparring over the Trump administration's allegations that Beijing steals technology and coerces foreign companies into handing over trade secrets. China denies it engages in such practices. The U.S. has also tried to rally other nations to block Chinese telecom firm Huawei from their upcoming 5G systems, branding the company a national security threat and barring it from buying American technology.

Mr. Trump said Saturday he would allow U.S. companies to sell their products to Huawei, but he was not yet willing to remove the company from a trade blacklist. The move could draw pushback from Democrats and congressional leadership.