NEW YORK (Reuters) - Oil prices rose and stocks rallied worldwide on Thursday after China said it had agreed with the United States to cancel tariffs in phases, a key consideration in reaching a deal to end a trade war that has crimped economic growth and roiled markets.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., November 6, 2019. REUTERS/Brendan McDermid

But U.S. stocks pared some gains after Reuters reported rolling back existing tariffs as part of a trade deal faces fierce opposition at the White House and from outside advisers, multiple sources familiar with the talks said.

The Dow and S&P 500 closed at record highs, while the Nasdaq missed a record close by less than two-tenths of a point.

A gauge of global equity performance surged to a 21-month peak, with a pan-European index at its highest since July 2015 after regional shares rose for a fifth straight session.

The dollar gained after comments from a Chinese commerce ministry spokesman about the terms of a potential trade deal prompted investors to dump perceived safe havens such as the Japanese yen, the Swiss franc, bonds and gold.

No timetable was indicated, but a “phase one” deal is widely expected to include a U.S. pledge to scrap tariffs scheduled for Dec. 15 on about $156 billion worth of Chinese imports, including cellphones, laptop computers and toys.

However, the idea of a tariff rollback was not part of the original October “handshake” deal between Chinese Vice Premier Liu He and U.S. President Donald Trump, sources told Reuters.

The initial news from China was positive, said David Kelly, chief global strategist at JPMorgan Funds in New York. But with operating earnings lower in a slowing economy, “the fundamental justification for this market increase is pretty weak.”

Investors have few options outside of equities, with the return in money markets and long-term government debt below the rate of inflation, Kelly said. The economy is generating plenty of wealth but it is all going to the stock market, he said.

Slideshow ( 2 images )

“The real driver (of the rally) is that investors in the United State and around the world have got little alternatives available to them because of the actions of the central banks,” Kelly said, “so they’re funneling money into stocks.”

MSCI’s gauge of stocks across the globe gained 0.28%, while the pan-European STOXX 600 index closed up 0.37%. Trade-sensitive German shares rose 0.83% to close at their highest since February 2018.

Asia had been quiet overnight, with the China news arriving just before European markets opened. Automakers and miners were among Europe’s top gainers.

The prospect of a recession diminishes if some tariffs are removed, said Peter Cardillo, chief market economist at Spartan Capital Securities in New York. “So that’s positive for stocks.”

On Wall Street, the Dow Jones Industrial Average rose 182.24 points, or 0.66%, to 27,674.8. The S&P 500 gained 8.4 points, or 0.27%, to 3,085.18 and the Nasdaq Composite added 23.89 points, or 0.28%, to 8,434.52.

The global benchmark for crude climbed above $62 a barrel. Brent crude settle up 55 cents at $62.29 and West Texas Intermediate added 80 cents to settle at $57.15 a barrel.

The dollar rose to near three-month highs versus the yen on the trade news, paring losses earlier in the session, while Australia’s China-sensitive dollar hit a near four-month high.

The dollar index rose 0.18%, with the euro down 0.15% to $1.1048. The yen weakened 0.25% versus the greenback at 109.27 per dollar, while the dollar gained against the Swiss currency, trading up 0.22% at 0.9948 franc.

U.S. Treasury yields rose to eight-week highs.

The benchmark 10-year U.S Treasury note fell 31/32 in price to push its yield up to 1.919%.

U.S. gold futures settled down 1.8% at $1,466.40 an ounce.

Copper got its customary lift from the China optimism as the country is the biggest buyer of the metal.

“Global markets in general are looking toward where trade goes,” said Justin Lederer, an interest rates strategist at Cantor Fitzgerald in New York. “The market is being dictated by headlines and it’s risk on, risk off.”