Lower oil and metal prices weighed on energy and mining stocks.

Couche-Tard (>> Alimentation Couche-Tard Inc) jumped 7.5 percent to C$66.78 after the company said it would buy U.S. chain CST Brands Inc in a roughly $4.4 billion deal.

"They're a quality name in a tape that's struggling to find quality, and especially a tape that's struggling to find quality growth," said John Stephenson, president at Stephenson & Company Capital Management.

Couche-Tard also said it would sell some Canadian CST assets to Parkland Fuel Corp (>> Parkland Fuel Corp), whose shares rose 15.9 percent to C$29.27.

Valeant Pharmaceuticals International Inc (>> Valeant Pharmaceuticals Intl Inc) advanced 9.7 percent to C$40.55 after hiring Zoetis Inc (>> Zoetis Inc) executive Paul Herendeen as CFO, the latest in a series of management changes at the drugmaker.

The Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> ended up 60.73 points, or 0.41 percent, at 14,748.19.

Advancers outnumbered decliners by 1.4-to-1 and eight of the index's 10 main groups closed in positive territory.

The energy group retreated 0.4 percent, with oil prices falling as China ramped up exports of refined products, U.S. oil producers added rigs for an eighth straight week and prospects emerged for increased exports from Iraq and Nigeria.

Cenovus Energy (>> Cenovus Energy Inc) fell 1.3 percent to C$19.58 and Crescent Point Energy Corp (>> Crescent Point Energy Corp) lost 2.4 percent to C$21.04.

"Energy just doesn't have enough going for it, at least not in Canada. Not at these prices and not at our cost structure," Stephenson said.

The materials group, which includes precious and base metal miners and fertilizer companies, lost 0.2 percent, as gold hit a two-week low and copper fell to its lowest in five weeks.

Goldcorp Inc (>> Goldcorp Inc.) shed 1.4 percent to C$23.24, one of six gold miners among the ten heaviest weights on the index.

The financials group added 0.3 percent, just ahead of the start of earnings season for the country's biggest banks.

Industrials gained 0.4 percent, while technology stocks rose 0.5 percent.

Canadian wholesale trade increased by 0.7 percent in June from May, the third consecutive monthly gain, Statistics Canada said.

(Reporting by Alastair Sharp; Editing by Bernadette Baum)

By Alastair Sharp