TORONTO - The Toronto Stock Exchange closed slightly higher Friday after a volatile day of trading in which the market had a hard time finding direction.

The S&P/TSX composite index added 10.38 points to 12,210.70 after briefly moving above 12,300 earlier in the day -- its highest level since September 2008.

The market was lifted by higher oil and gold prices, while pressure on the downside came from technology and base metals stocks.

Gold shares soared as the June bullion contract jumped $11.90 to US$1,180.70 an ounce -- its highest close in nearly five months. Shares in Barrick Gold Corp. (TSX:ABX) gained $1.27 or nearly three per cent to C$44.30.

The yellow metal was boosted by worried investors seeking a safe haven from the debt problems of Greece and other European countries.

Meanwhile, the price of oil posted its second day of big gains, adding 98 cents to US$86.15 a barrel amid a growing U.S. economy and concerns that an oil spill in the Gulf of Mexico will affect supply.

The Toronto energy sector added 0.61 per cent while shares in Encana Corp. (TSX:ECA) gained 67 cents or more than two per cent to C$33.60.

The technology sector was the biggest loser, tumbling 2.33 per cent amid weak earnings from Open Text Corp. (TSX:OTC). Shares in Open Text plunged $4.27 or more than nine per cent to $43.03.

The base metals sector fell 1.26 per cent as investors moved out of riskier commodities into gold. The May copper contract slipped 0.4 of a cent to US$3.34 a pound while shares in Teck Resources Ltd. (TSX:TCK.B) lost 78 cents to C$39.92.

The Canadian also dollar lost ground as security-seeking investors fled to the relative safety of the American greenback. The loonie fell 1.02 cents to 98.44 cents US.

This followed a report from Statistics Canada that the economy grew by 0.3 per cent in February, meeting economists' expectations. The agency said real gross domestic product was boosted by gains in manufacturing and mining.

Wall Street was negative after a report said the American economy grew at a less-than-expected 3.2 per cent in the first three months of the year. However, some specific signals of economic improvement fared better than expected, with consumer spending increasing by 3.6 per cent, the strongest showing since early 2007.

The Dow Jones industrial average slumped 158.71 points to 11,008.61. The S&P was down 20.09 points at 1,186.69, while the Nasdaq fell 50.73 points to 2,461.19.

New York markets had rallied in the previous two sessions, and may have already priced in the first-quarter GDP growth rate, said John Johnston, chief strategist of The Harbour Group at RBC Dominion Securities.

"I think we have to view the good economic news through the prism of: we're dealing with equity markets that have rallied a lot and a lot of good news is already discounted," Johnston said.

"Are current expectations on the part of the investors and the consensus views on earnings and the economy kind of maxing out here?" he asked.

The TSX Venture Exchange added 13.90 points to 1,673.87.

In corporate news, shares in Goldman Sachs Group Inc. (NYSE:GS) plunged nine per cent amid word that the U.S. Justice Department had opened a criminal investigation of the Wall Street powerhouse over mortgage securities deals. The criminal inquiry follows civil fraud charges filed by the U.S. government against Goldman two weeks ago. In Canadian earnings, Fairfax Financial Holdings Ltd. (TSX:FFH) reported a profit of US$290.2 million in its latest quarter, compared with a loss a year ago, helped by strong investment gains. Shares in Fairfax jumped $17.09 or 4.7 per cent to C$385. Forestry company Domtar Corp. (TSX:UFS) said it booked a US$58-million profit in the first quarter, reversing a year-earlier loss on price increases and higher pulp, paper and wood shipments. Still, Domtar's stock fell $4.61 or more than six per cent to $71.99.

TransCanada Corp. (TSX:TRP; NYSE:TRP), Canada's largest natural gas shipper and a growing power producer, reported that its net profit in the first quarter fell slightly to $303 million. Shares in TransCanada added 19 cents to $35.84.