WASHINGTON—President Trump and Chinese President Xi Jinping agreed to meet in Japan next week, lifting financial markets and spurring hopes for a trade truce that could stave off a fresh round of tariffs.

In a Twitter message on Tuesday, Mr. Trump said he had a “very good” telephone conversation with Mr. Xi, setting the stage for a summit on the sidelines of the Group of 20 leading global economies meeting in Osaka.

“We...