Canadian manufacturing sales rose in July at their fastest pace in 12 years after some automakers switched assembly lines back on after extended shutdowns and demand for primary metals rose sharply.

Statistics Canada said on Wednesday factory sales surged 5.5 percent in July from June to C$41.4 billion ($38.7 billion), topping market expectations of a 2.5 percent gain for the biggest monthly expansion since July 1997 when sales rose 5.8 percent.

Excluding motor vehicles and parts, shipments were up 2.1 percent.

Sales in the troubled auto industry leapt by 48.2 percent even though vehicle sales remained 23 percent below their value of a year earlier. Auto parts sales jumped 22.6 percent in the month.

Primary metals, used to make cars among other things, also pushed overall sales figure higher with an 11.2 percent gain.

The report follows other data showing the Canadian economy is pulling out of recession in the third quarter. Factory sales rose 2.2 percent in June, according to Statscan's revised figures, but analysts were skeptical of the June result because it was largely explained by the volatile aerospace industry. ($1 = $1.07 Canadian) (Reporting by Louise Egan; Editing by James Dalgleish)