Walmart Stores profit was down 1.3% during its fiscal year first quarter, but a surge in e-commerce and strong sales in the U.S. showed how the retailer continues to attract consumers during a challenging time in the industry.

The company posted $3.04 billion of net income equal to $1 a share, for its quarter that ended on April 30. Earnings were up from 98 cents a share for the same period one year ago beating expectations on Wall Street for 96 cents.

Revenue for its three-month period was up 1.4% to end the quarter at $117.5 billion but just came up short of expectations of analysts of $117.7 billion.

The performance by Walmart included a growth of 1.4% in its same-store sales, which are sales in stores that have been opened for at least the last year, and an increase of 1.5% in traffic in its domestic stores.

E-commerce sales for Walmart were much higher surging 63% during the quarter, which reflected the efforts by Walmart to expand its online footprint.

A strong first quarter was an encouraging start to 2017 said CEO of Walmart Doug McMillon. The company has moved faster combining physical and digital assets so shopping can be simpler and easier for our customers. The plan, said McMillon was gaining traction.

Walmart shares reached a high of 52 weeks during trading on Thursday and closed up $2.40.

The quarterly results proved to be a rare bright spot in a quarter that many other retailers that are also brick and mortar struggled in their attempts to attract shoppers.

Macy’s Dillard’s and J.C. Penney all posted disappointing quarter results early in May. Target posted an increase of 8% in profit on Tuesday, although its sales at same-stores dropped by 1.3%.

Walmart believes the success it enjoyed for the quarter was due to its ongoing efforts of improving and integrating its e-commerce and in-store businesses.

The huge retailer made heavy investments into cleaning up its U.S. stores that currently stand at 4,700, lowering prices, expanding its capabilities digitally and bulking up on its offerings online.

Walmart sales at same-stores in the U.S. were up for the 11th consecutive quarter and the company reported a tenth straight quarter of increased traffic.

The retailer posted net sales in the U.S. of $75.4 billion, an increase of 2.9% from the same period last year. Sales of general merchandise were down during the three month period due mainly from delays in checks for tax refunds.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.