The Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> closed up 30.02 points, or 0.21 percent, at 14,582.74.

It slipped 0.1 percent on the week, after four straight weeks of gains.

The energy group rose 0.7 percent, while the materials group, which includes precious and base metals miners and fertilizer companies, gained 1 percent as gold prices rose on weak U.S. economic growth.

Barrick Gold Corp (>> Barrick Gold Corp.) added 1.7 percent to C$28.51 and Detour Gold Corp (>> Detour Gold Corporation) jumped 7.3 percent to C$34.14.

Pipeline operator Enbridge (>> Enbridge Inc) jumped 4.5 percent to C$53.71 and Canadian Natural Resources Ltd (>> Canadian Natural Resources Limited) rose 0.8 percent to C$39.54.

Economic data and energy earnings out on Friday highlighted the damage done by a massive wildfire that hit Canadian oil sands production starting in May, and while crude steadied on the day, it finished the month nearly 15 percent lower.

Diana Avigdor, a portfolio manager and head of trading at Barometer Capital Management, said she had cut exposure to energy stocks and the Canadian market in recent weeks.

She said she would wait to see if higher oil prices, which she expects to trade between $25 and $75 a barrel over the next three to five years, can boost the index from here.

"In Canada it is really going to depend on the price of oil," she said. "When oil rallied to $50 we saw how quickly supply came back, and that's why we see it back at $40 now."

Shares in Air Canada (>> Air Canada) fell 4.8 percent to C$8.99 after the country's largest airline posted second-quarter results that raised concerns about downward pressure on fares.

Six of the index's 10 main groups ended in negative territory, although advancers outnumbered decliners by a 1.5-to-1 ratio.

(Reporting by Alastair Sharp; Editing by Jeffrey Hodgson)

By Alastair Sharp