TORONTO - While international retailers Costco and Walmart have gobbled up a growing share of Canadian food sales for more than a decade, further gains are expected to be tougher to eke out as the country's traditional grocers mount an improved defence.

Industry watchers say the price gap between the two sides has narrowed and the traditional stores' loyalty programs are helping support sales.

"Every point of market share is hard fought over in the grocery market," said Kenric S. Tyghe, a consumer and retail analyst at Raymond James. "The traditional grocers have done a better job defending share than, I think, a lot of observers expected."

While they have operated in Canada for years, competition from Costco and Walmart is still top of mind for local grocers given the low-cost strategy of the two foreign giants.

In his most recent quarterly call with analysts in April, Metro CEO Eric R. La Fleche discussed Costco's expansion in Ontario, saying it is "a significant competitor, and we have to execute and differentiate."

In the second quarter of 2004, traditional grocery stores sold about $12.3 billion worth of food, accounting for about 90 per cent of the market, according to Statistics Canada data. General merchandisers, which include Costco and Walmart, sold about $1.3 billion or roughly 9.8 per cent.

In the same quarter of 2016, traditional grocers' market share fell to about 79.2 per cent, while that of the general merchandisers more than doubled.

Those changes translate "into billions and billions of dollars every quarter," said Kevin Grier, an agriculture and food market analyst, adding that the shift in market share to the U.S. chains is expected to slow.

"You can't keep that up," he said.

Canadian grocers were granted some respite from foreign-owned competitors when Target, which entered the Canadian market in 2013, pulled out of the country in 2015.

Costco now operates 95 warehouses in Canada, while Walmart runs 410 stores. Costco plans to open three more stores by the end of this year for a total of seven new stores in 2017. Spokesman Ron Damiani said that's the most sites the company's opened in a financial year in recent memory.

While Walmart has not revealed any new expansion plans, it announced in 2015 it would add 42 supercentre locations.

Tyghe said that pace of expansion will not create the sort of disruption and dislocation seen when growth in square footage at the two chains outpaced population increases, forcing Canadian grocers to lower prices.

The traditional grocers have also boosted their discount banner store counts, Tyghe said, keeping their hold on the most price-oriented customers.

Loblaw, for example, operates 500 discount banner stores, including No Frills, across Canada.

"We believe we have some of the strongest, most effectively operated and most customer-centric discount formats in the country," Loblaw CEO Galen G. Weston said in an interview after the company's annual meeting earlier this month.

For the average Canadian shopper, that means the price difference between a product at a traditional grocer and a Costco or Walmart is not necessarily compelling enough to justify shopping at two separate locations, Tyghe said.

"You're not going to win on price alone," he said.

Another factor favouring traditional grocers is their strong loyalty programs, which give them robust customer data and the ability to target promotional offers to individuals based on their shopping habits, Tyghe said.

"How they respond is increasingly in a very data-driven, targeted, promotional way," he said.

- With files from Linda Nguyen