(Adds management comments, quarterly outlook)
CHICAGO, Aug 17 (Reuters) - Wal-Mart Stores Inc on Thursday reported lower quarterly profit margins and indicated earnings for the current period could miss analysts' estimates as it cut prices and spent heavily to expand its e-commerce operations.
The retailer's shares fell nearly 2 percent, with investors shrugging off sales that defied sluggish consumer demand that hurt many rivals. Wal-Mart has shown three straight years of comparable sales growth as more people shopped at its stores and made purchases online.
With a steady rise in the number of people who shop online, e-commerce sales growth has been outpacing brick-and-mortar.
Like other retailers, Wal-Mart has been aggressively investing in its e-commerce business in the past year. It has begun offering programs like free-two-day shipping and discounts for picking up online purchases at stores, and it acquired several startups, including Jet.com for $3.3 billion last year.
The company's online sales growth outpaced the industry at 60 percent but decelerated from the 63 percent increase in the previous quarter. Wal-Mart said most of the growth has come from its own online business and not the acquisitions it has made in the past year.
Sales at U.S. stores open at least a year rose 1.8 percent, excluding fuel price fluctuations and including e-commerce, during the second quarter ended on July 31. That exceeded market expectations for a 1.7 percent increase, according to research firm Consensus Metrix.
The company cited its grocery and food business, which reported its best performance in five years, and said its online operation added 70 basis points to comparable sales.
U.S. store visits were up 1.3 percent from 1.2 percent a year earlier.
Total revenue increased 2.1 percent to $123.4 billion from a year earlier. It would have been up 2.9 percent without the effects of currency fluctuations, which the company said had diminished from previous quarters.
Net income attributable to Wal-Mart fell 23 percent to $2.9 billion due to a loss from repurchasing debt after a bond tender offer. Excluding special items, earnings per share of $1.08 exceeded the analysts' average estimate of $1.07, according to Thomson Reuters I/B/E/S.
Gross margins were down 11 basis points at 25 percent, including a five-basis-point decline in the United States, compared with analysts' expectations of 25.22 percent.
Operating margins fell to 4.9 percent from 5.1 percent, and U.S. operating expenses rose 3.9 percent.
The company said it expected third-quarter earnings of 90 cents to 98 cents a share, excluding special items. Analysts on average had forecast 98 cents.
Wal-Mart raised the low end of its earnings outlook for the full year to $4.30 per share from $4.20, excluding items, while keeping the high end at $4.40. (Reporting by Nandita Bose in Chicago; Editing by Lisa Von Ahn)