(Reuters) - Walmart Inc posted its strongest holiday quarter in at least a decade on Tuesday, boosted by higher grocery and e-commerce sales, and said it saw no signs of weakness in U.S. consumer spending despite recent signs of a slowdown.

Online sales jumped 43 percent in the quarter helped in particular by the expansion of Walmart’s online grocery pickup program to more than 2,100 stores by year end.

Shares of the world’s largest retailer rose 2.2 percent on Tuesday in a broadly flat market, putting them up 9.7 percent so far this year.

Walmart and rival Target Corp’s unexpectedly strong growth in holiday sales reflected the health of the U.S. consumer as spending remained robust due to a strong labor market and cheaper gasoline prices.

“We still feel pretty good about the consumer. We haven’t seen much of a change,” Walmart Chief Financial Officer Brett Biggs told Reuters. “The data we are seeing still looks pretty healthy. Gas prices are down year over year, which helps.”

Investors and Wall Street analysts have been expecting U.S. spending to slow this year, against a backdrop of rising debt, trade tariffs and economic uncertainty. Walmart’s results settled nerves, but some doubts remain.

“There are definitely some storm clouds on the horizon,” said Charles Sizemore, founder of Sizemore Capital Management LLC, which owns Walmart shares. “A big example would be delinquent loans in the auto sector which are rising ... the consumer may be on hard times and in 2008 that was the prelude to the global economic slowdown.”

U.S. retail sales recorded their steepest drop in more than nine years in December, the government reported last week, as receipts fell across the board, suggesting a sharp slowdown in economic activity at the end of 2018.

However, overall sales for the 2018 U.S. holiday shopping season hit a six-year high as shoppers were encouraged by early discounts, according to a Mastercard report in late December.

FILE PHOTO: Walmart's logo is seen outside one of the stores in Chicago, Illinois, U.S., November 20, 2018. REUTERS/Kamil Krzaczynski/File Photo

Walmart sales at U.S. stores open at least a year rose 4.2 percent, excluding fuel, in the fourth quarter ended Jan. 31. The gain exceeded analysts’ expectations of 2.96 percent, according to IBES data from Refinitiv.

Sales were boosted by federal officials distributing food stamp aid early during the partial government shutdown. The demise of retailer Toys R Us also helped Walmart gain toy market share, the company said.

Adjusted earnings per share increased to $1.41 per share, beating expectations of $1.33 per share, according to Refinitiv. But the retailer’s gross margins declined for the seventh consecutive quarter due to higher transportation costs and e-commerce investments.

ONLINE SALES JUMP

Walmart’s 43 percent rise in online sales matched the previous quarter’s increase, and the company credited a broader assortment on its website and improved delivery, as well as store pickup of online grocery orders.

Higher online grocery sales helped it expand market share in the category, Walmart said. It will have the store pickup service at 3,100 stores by next January.

Walmart will offer grocery deliveries to about 800 more stores by the end of the year, bringing the total to 1,600 stores.

But the company reiterated that it expected e-commerce losses to increase this year due to ongoing investments. Chief Executive Officer Doug McMillon said on a conference call the company was focused on getting return customer visits and strengthening product assortment.

Grocery sales currently make up 56 percent of total revenue for the retailer. Amazon.com Inc is trying to crack the food category, especially since it bought organic supermarket chain Whole Foods.

Walmart is partnering with third-party couriers and working with so-called gig, or freelance, drivers, who are cheaper than full-time employees, to push down costs, Reuters recently reported.

Google-backed Deliv, a Walmart delivery partner in Miami and San Jose, ended its relationship with the retailer, Reuters reported last week.

The U.S. retailer, which overtook Apple Inc to become the third largest e-commerce retailer last year, is likely to capture a 4.6 percent share of the U.S. e-commerce market, behind eBay Inc and Amazon, according to research firm eMarketer.

Walmart repeated its forecast that fiscal year 2020 earnings per share would decline in the low single digits in percentage terms, compared with last year. Excluding the acquisition of Indian e-commerce firm Flipkart, it sees an increase in the low- to mid-single-digits.

McMillon said the company was disappointed in India’s revised e-commerce regulations, which ban companies from selling products via firms in which they have an equity interest and also bar them from making deals with sellers to sell exclusively on their platforms.

He said the Indian government didn’t consult with Walmart and other U.S. companies before it changed the rules. “We hope for a collaborative regulatory process going forward, which results in a level playing field,” he said.

Walmart expects fiscal year 2020 comparable sales growth of 2.5 percent to 3 percent, excluding fuel and online sales growth of 35 percent.

Total revenue increased 1.9 percent to $138.8 billion, beating analysts’ estimates of $138.65 billion. Walmart has recorded 18 quarters, or over four straight years of U.S. comparable sales growth, unmatched by any other retailer.

The stock rose 3.7 percent to $103.68. Target and Costco Wholesale Corp were both up more than 1 percent.