The Toronto stock market turned higher late Tuesday morning thanks to strength in consumer staples and gold miners.
But commodity prices lost ground amid questions about the economic impact from a looming U.S. government fiscal fight.
The S&P/TSX composite index gained 42.51 points to 12,853.69.
The Canadian dollar was off 0.16 of a cent to 97.07 cents US as data showed that retail sales in Canada rose by 0.6 per cent during July to $40.3-billion, which was in line with economists' expectations.
Statistics Canada said the advance in retail sales was led by a 3.2 per cent rise in sales at gasoline stations.
U.S. indexes moved into positive territory as traders digested data showing stronger house prices along with a dip in consumer confidence.
The Dow Jones industrials rose 26.04 points to 15,427.42 as the Standard & Poor's/Case-Shiller 20-city home price index rose 12.4 per cent in July compared with a year ago, the most since February 2006. An increase in sales on a limited supply of available homes drove the gains.
Meanwhile, the U.S. Conference Board reported its consumer confidence index for September came in at 79.7, down slightly from August.
The Nasdaq was ahead 15.21 points to 3,780.5 and the S&P 500 index climbed 2.8 points to 1,704.64.
The approaching budget battle between the White House and Republican lawmakers has cast a shadow over markets. The government will reach its borrowing limit, or debt ceiling, by Oct. 1. If Congress doesn't raise that limit, the government won't be able to pay all its bills.
Republicans are demanding that any increase must result in expenditure cuts of an equal amount. President Barack Obama is demanding a debt limit increase with no conditions attached.
"It's never a good thing when the markets are spending time focused on rancour and brinkmanship in Washington instead of being focused on what are some pretty reasonable fundamentals that we're getting," said Craig Fehr, Canadian markets specialist at Edward Jones in St. Louis.
"You take the gains we have seen so far this year and you couple that with the potential distractions on the horizon and investors are a bit more inclined to take a wait and see approach in terms of what Washington may do."
The U.S. Federal Reserve added to the uncertainty.
Markets had initially rallied last week after the Fed surprised markets with its announcement that it won't be cutting back its massive economic stimulus program just yet. The $85-billion (U.S.) in monthly asset purchases by the central bank have helped keep rates low and supported strong gains on stock markets.
But the Fed is still expected to scale back on those asset purchases later this year.
Consumer staples led advancers, up 0.8 per cent as convenience store chain Alimentation Couche-Tard (TSX:ATD.B) gained $1.09 to $64.80.
Financials also found support with TD Bank (TSX:TD) ahead 75 cents to $92.10.
Worries about the economic fallout from such a budgetary impasse pressured commodity prices.
The base metals sector was slightly lower with December copper down four cents to $3.25 a pound.
The gold sector shed 0.2 per cent as December bullion faded $10.50 to $1,316.50 an ounce.
The energy sector was little changed while the November crude contract on the New York Mercantile Exchange dipped 64 cents to $102.95 a barrel. Oil has dropped more than six per cent since closing at a two-year high of $110.53 on Sept. 6.
BlackBerry shares (TSX:BB) (NASDAQ:BBRY) weakened following a move to take the company private. BlackBerry has signed a letter of intent with a consortium led by its biggest shareholder, Fairfax Financial (TSX:FFH) that involves shareholders getting $9 (U.S.) a share. The company's shares were down 45 cents to $8.88 on the TSX and off 21 cents to $8.61 (U.S.) in New York.
In corporate news, Sears Canada (TSX:SCC) has named Douglas Campbell as its new president and chief executive officer. He replaces Calvin McDonald, who spearheaded a number of major initiatives to reposition the company in a hotly competitive marketplace. He resigned to pursue an opportunity with a "leading international company," which wasn't identified. Its shares were off six cents at $12.35.
Chip-making equipment manufacturer Applied Materials is acquiring Tokyo Electron Ltd., a rival maker of equipment for production of semiconductors, flat panel displays and solar panels. The two companies said Tuesday their all-stock transaction will result in the creation of a new company with market capitalization of $29-billion (U.S.).
Overseas, London's FTSE 100 index and Frankfurt's DAX rose 0.14 per cent while the Paris CAC 40 rose 0.35 per cent.