TORONTO -- Brightened prospects of a breakthrough in the trade war between the world's two largest economies propelled U.S. stock markets to new record highs and pushed Canada's main index higher Thursday.

"Many were hoping for a trade detente and some of the headlines are suggesting it'll be a detente and even a little bit of a removal of some of the headwinds," said Michael Greenberg, portfolio manager at Franklin Templeton Multi-Asset Solutions.

China and the United States agreed to reduce punitive tariffs on each other's goods as part of a phase one agreement.

"So that's maybe a little bit better than people expected."

An agreement isn't surprising given that U.S. President Donald Trump would likely want to avoid a "barn brawl" that could wreak havoc with the economy heading into next year's presidential election, said Greenberg.

"So he's motivated to kick the can down the road," he said, referring to delicate topics not included in the preliminary agreement.

Trade uncertainty has hurt the economy so the potential removal of that has pushed stock markets higher.

The S&P/TSX composite index closed up 60.11 points at 16,805.75, just 142 points away from the 16,947.23 record high set in September.

In New York, the three U.S. markets hit intraday records before the Dow Jones industrial average closed up 182.24 points at 27,674.80, a record close. The S&P 500 index was up 8.40 points at 3,085.18, also a record close. The Nasdaq composite was up 23.89 points at 8,434.52.

In addition to trade optimism, markets are still buoyed by lingering comments from the last Federal Reserve meeting where the central bank suggested its focus on inflation means interest rates are unlikely to increase if the U.S. economy takes off, said Greenberg.

"So that's kind of taken away some of the fear that if things get going the Fed's going to rain on the party," he said in an interview.

The Canadian dollar traded for 75.90 cents US compared with an average of 75.88 cents US on Wednesday.

The TSX was driven higher by a 4.2 per cent gain by the energy sector. Canadian Natural Resources climbed 8.3 per cent after it reported higher oil production and financial results that beat expectations. Crescent Point Energy Corp was up 5.8 per cent and Cenovus Energy Inc. 4.2 per cent.

The December crude contract was up 80 cents at US$57.15 per barrel and the December natural gas contract was down 5.6 cents at US$2.77 per mmBTU.

Crude prices gained on expectations that a trade deal will support demand. OPEC's proposed efforts to convince all members to abide by previous supply cuts also supported higher prices, said Greenberg.

Materials was the big loser on the day as gold prices fell to their lowest level in three months.

The December gold contract was down US$26.70 at US$1,466.40 an ounce and the December copper contract was up 6.25 cents at US$2.73 a pound.

Shares of Semafo Inc. lost another five per cent on top of the 11 per cent on Wednesday after the Montreal-based gold miner suspended operations at its Boungou mine in Burkina Faso a day after at least 37 people were killed in an ambush on their way to the site.

While improved trade sentiment and traditional end-of-year gains have supported the market increases, low interest rates has left investors with limited alternatives, said Greenberg.

"It's been engineered a bit in that way to push investors into riskier assets and in a lot of cases if you're trying to earn a yield you have to go up the risk spectrum because there's just not a lot on offer in kind of the safe stuff."

The market increase is also supported by a rotation by investors and those with large cash positions coming off the sidelines, he said.

"That could be also somewhat fuelling the rise that we're seeing."