NEW YORK (Reuters) - Global equity markets and oil prices rose on Friday after China and the United States agreed on an initial trade deal that rolls back some U.S. tariffs in exchange for China’s increased purchase of farm goods, cooling a contentious trade war.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in Manhattan, New York City, U.S., December 21, 2016. REUTERS/Andrew Kelly

The “phase one” agreement came just ahead of a deadline on Sunday for a new round of U.S. tariffs on almost $160 billion of Chinese imports. The 17-month-old trade dispute has roiled financial markets and taken a toll on world economic growth.

Beijing agreed to buy $32 billion in additional agricultural goods over the next two years, U.S. officials said, up from a baseline of $24 billion purchased in 2017, before the trade dispute started.

U.S. President Donald Trump said he thought China would hit $50 billion in agricultural purchases.

The deal was announced as the Democratic-controlled U.S. House of Representatives Judiciary Committee voted to charge Trump with abuse of power and obstruction during an impeachment inquiry.

MSCI's gauge of global equities .MIWD00000PUS rose 0.55%, while the pan-European STOXX 600 index .STOXX gained 1.25%, boosted by hopes of an orderly Brexit after a landslide victory for UK Prime Minister Boris Johnson in Thursday's elections.

But U.S. stocks pared initial gains on the news of a preliminary U.S.-China trade deal. Given the heated nature of the dispute between the world’s two largest economies, investors were slow to embrace the news fully, as both sides have engaged in brinkmanship.

Investors are weary of the rhetoric, while on the margin Johnson’s victory is bigger news than what could be viewed as trade positioning, said Jack Ablin, chief investment officer at Cresset Capital Management. “Investors at this point are tired of the talk and are looking for a handshake,” he said.

The back and forth in trade talks between China and the United States is emblematic of a great power struggle, said James Clunie, manager of the Jupiter Absolute Return Fund.

“If there are two great countries locked in a strategic war, which is what a great power struggle is, then that is not going away, that is probably with us for a long time,” he said.

MSCI's gauge of global stock performance .MIWD00000PUS and the three main U.S. equity indexes hit record highs.

The Dow Jones Industrial Average .DJI rose 3.33 points, or 0.01%, to 28,135.38. The S&P 500 .SPX gained 0.23 point, or 0.01%, to 3,168.8 and the Nasdaq Composite .IXIC added 17.56 points, or 0.2%, to 8,734.88.

Earlier in Asia, Japan's Nikkei .N225 climbed 2.5% to a 14-month high and Shanghai blue chips .CSI300 advanced 2%.

Sterling gained following Johnson’s win of a commanding majority in Britain’s Parliament, giving him the power to deliver a clear exist from the European Union, though trade talks are set to drag on for months, if not years.

UK shares exposed to Britain's economy surged, with the benchmark FTSE 100 .FTSE index gaining more than 2% at one point as the rally offset the drag from a jump in sterling.

The pound GBP= rose to a 19-month high against the U.S. dollar and shares in Europe rose to near all-time highs as investors cheered the likelihood of an orderly Brexit. Sterling GBP= last traded at $1.3335, up 1.31%.

The dollar fell against a basket of currencies as the prospect of a China-U.S. trade deal and the British election results sapped safe-haven demand for the greenback. The dollar index .DXY fell 0.21%, with the euro EUR= down 0.09% to $1.1118. The Japanese yen JPM= weakened 0.03% versus the greenback at 109.36 per dollar.

Oil rose to its highest level in nearly three months as investors cheered the progress in resolving the U.S.-China trade dispute and the decisive election result in Britain. Brent LCOc1 crude, the global benchmark, rose $1.02 to settle at $65.22 a barrel. U.S. West Texas Intermediate (WTI) CLc1 settled up 89 cents at $60.07 a barrel.

During the session, both contracts jumped to their highest levels since Sept. 17, with WTI topping $60 a barrel.

Gold prices were little changed as risk appetite was boosted by the progress in the U.S.-China trade talks, though investors remained cautious. U.S. gold futures GCcv1 settled up 0.6% at $1,481.20 an ounce.

U.S. benchmark 10-year Treasury notes US10YT=RR rose 23/32 in price to yield 1.8191%.