Wal-Mart's 2Q Earnings Beat, Outlook Raised, Shares Jump

Wal-Mart reported stronger-than-expected same-store sales growth in the latest period, with slightly more shoppers heading to its stores at a time when many retailers are struggling to attract foot traffic.

The retailer also lifted its profit outlook for the year. Shares rose 3.1% to $75.18 in premarket trading, which would be the highest level in a year for the stock.

Same-store sales at Wal-Mart's U.S. stores rose 1.6%, above its guidance for a 1% increase. Meanwhile, traffic rose 1.2%.

Many traditional retailers have struggled recently to grow sales and adjust to customer's changing online shopping habits. Target Corp. said Wednesday that same-store sales fell for the first time in more than two years as fewer shoppers visited its locations, while Macy's Inc. last week said it would shut 100 more stores, or 14% of its physical base, as shoppers increasingly opt to make purchases online and spend more on services than on goods.

Demand for clothing and household items in recent years has been markedly softer than during past economic recoveries. What demand there is has been shifting online away from traditional retailers such as Macy's, Kohl's Corp. and Nordstrom Inc., which all reported lower quarterly sales this week.

Bentonville, Ark.-based Wal-Mart has been spending heavily to get customers back into its stores. It has worked to better stock its stores, improve efficiency and boost the pay for its employees. "Comp store inventory was down 6.5% and in-stock levels are up," said Wal-Mart chief executive Doug McMillon on a conference call. Operating, selling, general and administrative expenses climbed 4.6% in the latest period.

The company has also invested in its lackluster online operations as Amazon.com Inc. continues to grow sales quickly. Earlier this month, the company announced plans to purchase discount e-commerce retailer Jet.com Inc. for $3.3 billion, the largest purchase to date of an e-commerce startup. Wal-Mart also tapped Jet's founder Marc Lore to lead its e-commerce efforts once the deal is complete.

In the second quarter, Wal-Mart reported global e-commerce sale rose 11.8%, the first time in nine quarters the retailer's online sales growth has increased quarter-over-quarter.

During the quarter Wal-Mart offered a free monthlong trial of a $49 two-day shipping membership similar to Amazon's popular Prime program and rapidly ramped up the number of items available on Walmart.com. Until May, the technology behind Wal-Mart's website capped the number of products it could display to shoppers at around 8 million. "We made advancements in the U.S. on our key priorities to build digital relationships with customers, scale the assortment and expand online grocery," said Mr. McMillon. Walmart.com now sells 15 million items, he said.

Wal-Mart is also trying to make its produce, meat and grocery business more prominent for shoppers, an effort at the heart of its plan to fend off Amazon as consumers still tend to shop offline for fresh food. During the quarter, the company reported strong traffic in food and consumables, such as beauty and cosmetics, in its grocery segment. The company also reported stronger pharmacy sales, helped by drug price inflation and more prescriptions filled.

Meanwhile, apparel sales were helped by a focus on basics, though entertainment sales were soft. Target also reported weakness in electronics sales.

Over all, Wal-Mart reported earnings of $3.77 billion, or $1.21 a share, compared with a year-earlier profit of $3.48 billion, or $1.08 a share. Excluding the gain from the sale of its Yihaodian website in China, the company earned $1.07 a share. The company had said earnings would land between 95 cents and $1.08 a share.

Revenue edged up 0.5% to $120.85 billion. In constant currency, revenue rose 2.8%. Analysts estimated $120.16 billion in revenue.

The company now sees full-year earnings in a range of $4.15 to $4.35 a share. Analysts were expecting $4.27. The company previously guided for earnings between $4.00 and $4.30. For the current quarter, the company is projecting 90 cents to $1 in per-share earnings, in line with the consensus estimate for 94 cents a share.

Write to Joshua Jamerson at joshua.jamerson@wsj.com and Sarah Nassauer at sarah.nassauer@wsj.com