Walmart says its Canadian stores gained market share against rivals during its fiscal second quarter.

"We further improved our price position against competitors, which contributed to market share gains in key traffic driving categories such as food and consumables," Walmart chief financial officer Brett Biggs said in remarks prepared for analysts during a conference call to discuss its most recent results Thursday.

"Inventory was also a focus, as the team reduced overall levels, even as sales increased."

In Canada, Walmart's biggest competitors in the food segment are the major domestic grocery chains owned by Loblaw, Empire, Metro and the Canadian arm of Costco.

Sales rose faster in Canada than in U.S.

Walmart Canada's comparable-store sales rose 2.5 per cent, trailing only the Mexican arm's 7.2 per cent growth and ahead of the United States (1.8 per cent), United Kingdom (1.8 per cent) and China (0.6 per cent).

Overall revenue for the three months ended July 31 climbed to $123.36 billion US, from $120.85 billion US. Wal-Mart's international revenue was down 1.5 per cent at $29 million US, due to divestitures.

Walmart's online sales surged 60 per cent. The results beat the $122.71 billion US that analysts surveyed by Zacks Investment Research were looking for.

There are signs that traditional retailers are gaining traction online in the face of intense competition from Amazon.com. On Wednesday, Target said its online sales jumped 32 per cent in its most recent quarter.

And Walmart's effort to revitalize traffic in stores continues to gain ground. Sales at U.S. stores open at least a year increased 1.8 per cent, the 12th straight quarter of growth for the figure. Traffic rose 1.3 per cent.

Walmart Stores Inc. earned $2.9 billion US, or 96 cents per share, for the quarter. A year earlier the Bentonville, Arkansas-based company earned $3.77 billion US, or $1.21 per share.

Stripping out certain items, earnings were $1.08 per share. That was a penny better than what analysts polled by Zacks expected.

The retailer anticipates 2018 adjusted earnings of between $4.30 and $4.40 per share. It predicts third-quarter earnings of 90 to 98 cents per share. Analysts polled by FactSet predict full-year earnings of $4.36 per share and third-quarter earnings of 97 cents per share.