TORONTO -- The Toronto stock market closed higher Wednesday as rising oil and gold prices offset disappointing economic data south of the border.

The S&P/TSX composite index closed up 40.11 points at 14,942.55 while the loonie rose 0.25 of a U.S. cent to 79.20 cents.

In the U.S., markets were sharply lower amid a string of disappointing economic reports. The Dow Jones industrial average closed down 77.94 points at 17,698.18, the Nasdaq lost 20.66 points to 4,880.23 and the S&P 500 was off 8.20 points at 2,059.69.

"We were all expecting the economy to come out of this period on sustainable footing and a few data points seem to suggest that maybe we're on shakier ground than we thought," said Patrick Blais, senior portfolio manager at Manulife Asset Management.

A report from the ADP private payrolls firm said 189,000 new jobs were created in March -- below market expectations for an increase of around 250,000.

As well, the closely followed ISM survey of manufacturing executives fell in March for a fifth consecutive month, hitting its lowest level since mid-2013, as it slipped to 51.5 from 52.9 in February.

Blais said strength in the U.S. currency and weakness in foreign economies are largely to blame for the disappointing U.S. manufacturing data.

Meanwhile, consumer spending has been lagging year-to-date, although Blais said that is likely weather-related and will prove to be temporary.

U.S. auto sales were up less than one per cent in March compared with the same month a year ago -- a slowdown from the 14 per cent gain seen in January and the five per cent gain in February.

Construction spending also decreased in February, according to the U.S. Commerce department. A slight increase had been expected.

On the commodity markets, the May crude oil contract was up $2.49 at US$50.09 a barrel as U.S. domestic crude production fell for the first time since the end of January and delays were reported in negotiations with Tehran over Iran's nuclear program. A deal with Tehran could lead to reduced sanctions on the Middle East oil exporter and send even more oil flooding already glutted world markets.

"What's good for oil is good for Canada," said Blais.

However, U.S. government data did show that crude inventories in the United States rose by 4.8 million barrels in the week ended March 27. That was more than the 4.2 million barrels expected by analysts.

Gold prices also rose sharply, with the June bullion contract up $25 at US$1,208.20 an ounce.

Despite the troubling figures out of the U.S., Blais said Europe -- which has been casting a shadow over the global economy lately -- is showing signs of recovery.

"If they're at a point where they can deliver economic growth through a combination of quantitative easing, restructuring, a lower currency and a lower oil price, then I think that will be taken as an overall positive for equity markets," he said.