KUALA LUMPUR, Malaysia (AP) — U.S.-China trade tensions appeared to cool Sunday before an upcoming meeting between President Donald Trump and Chinese leader Xi Jinping, with each side saying a deal was nearing between the world’s two largest economies.

Any agreement would be a relief to international markets even it does not address underlying issues involving manufacturing imbalances and access to state-of-the-art computer chips.

Beijing recently limited exports of rare earth elements that are needed for advanced technologies, and Trump responded by threatening additional tariffs on Chinese products. The prospect of a widening conflict risked weakening economic growth worldwide.

China’s top trade negotiator, Li Chenggang, told reporters that the two sides had reached a “preliminary consensus,” while Trump’s treasury secretary, Scott Bessent, said there was “a very successful framework.”

Trump also expressed confidence that an agreement was at hand, saying the Chinese “want to make a deal and we want to make a deal.” The Republican president is set to meet with Xi on Thursday in South Korea, the final stop of his trip through Asia. Trump reiterated that he plans to visit China in the future and suggested that Xi could come to Washington or Mar-a-Lago, Trump’s private club in Florida.