The U.S. and China reached a partial agreement in their 18-monthslong trade dispute Friday, opening the way for a more comprehensive deal that could be signed by U.S. President Trump and Chinese leader Xi Jinping when the two leaders meet later this year.

The agreement includes agricultural concessions from China and U.S. agreement on some tariff relief. Trump acknowledged to reporters, however, the phase 1 deal is not yet in writing, a process that could take five weeks.

Trump and Xi are expected to sign the deal next month at the Asia-Pacific Economic Cooperation summit.

High-level negotiations involving Chinese Vice Premier Liu He and U.S. Trade Representative Robert Lighthizer and Treasury Secretary Steven Mnuchin began Thursday. Trump was scheduled to meet with Liu later Friday.

"We have had a productive two days of discussions," Mnuchin said just before briefing the president. 

Optimism over the trade talks sent U.S. equities soaring.

Trump teased the possibility of an agreement Thursday on his Twitter account, saying China really wanted a deal, but before the talks began, China took some of the thornier issues off the table.

The U.S. had been preparing a 5-point increase in tariffs on $250 billion worth of Chinese goods to take effect next Tuesday, boosting the levies to 30%.

“Given the weakening US economy and President Trump’s reliance on a strong economy to buoy his re-election campaign, Mr. Trump needs to claim a win in the trade negotiations prior to next year’s election,” said Robert Johnson, professor of finance at Heider College of Business at Creighton University when asked about the prospects of a deal.

Johnson predicted any agreement would not “dramatically alter the status quo.”

“Both the U.S. and China know they are in a game of chicken. And in any game of chicken, if you don’t correct course, you’re going to crash,” said Dan Passarelli, president of Market Taker Mentoring. Noting that trade wars weaken the global economy, “both countries are racing [an] unspoken clock, that is, if we get to the point of recession, no one wins.”

Joseph Trevisani, senior analyst at FXStreet said a partial deal will be good for both the U.S. and Chinese economies, far more potent than anything either country’s central bank could conjure.

“A deal would strengthen each president's domestic and international position. For Xi Jinping it would likely mute US criticism should it move in force into Hong Kong and for Donald Trump a strong economy is his best ally in the 2020 election,” Trevisani said.