Wal-Mart shares surged to an all-time high, jumping more than 10 percent Thursday after the world's largest retailer showed it can hold its own in a challenging retail environment.

Same-store sales for its U.S. locations climbed for the 13th-consecutive quarter, as the big-box retailer cited a bright spot in its food business and a boost from shoppers stocking up on hurricane supplies.

The Arkansas-based company reported strong growth online, with e-commerce sales soaring 50 percent in the fiscal third quarter, a year after it acquired Jet.com. That's a slower pace than in the prior period when digital sales were up 60 percent.

Wal-Mart also raised its full-year earnings expectations, taking an aggressive stance heading into the important holiday season.

Here's what Wal-Mart reported, compared with what Wall Street was expecting, based on a Thomson Reuters survey of analysts:

Earnings of $1 a share, excluding items, compared with a forecast profit of 97 cents per share.

"We have momentum, and it's encouraging to see customers responding to our store and eCommerce initiatives," CEO Doug McMillon said in a statement.

"Existing customers have become advocates for popular initiatives like online grocery and free two-day shipping, and as a result, new customers, suppliers and partnerships are coming to Walmart."

In the third quarter, Wal-Mart reported net income of $1.75 billion, or 58 cents a share, which included a $283 million charge to account for a likely fine related to a Foreign Corrupt Practices Act violation investigation that has been ongoing since 2012. Excluding that charge and other one-time costs, Wal-Mart earned $1 a share, outpacing Wall Street estimates.

A year ago, Wal-Mart posted net income of $3.02 billion, or 98 cents a share.

Total revenue for the third quarter climbed 4.2 percent, to $123.18 billion from $118.18 billion. This included sales growth of 4.3 percent for Wal-Mart's U.S. business, 4.1 percent growth for Wal-Mart's international stores and 4.4 percent growth at Sam's Club.

The average ticket at Wal-Mart's U.S. stores was up 1.2 percent, helped by the rapid growth of its food business. Wal-Mart said its grocery categories delivered the strongest quarterly comparable sales performance in nearly six years, with fresh meat, bakery and produce leading the way.

"Market share in the critical food category continues to grow as the expansion of its buy-online/pick-up in store capability is driving increased sales, and the focus on improving working capital continues," Moody's retail analyst Charlie O'Shea wrote in a note to clients.

"As usual, we expect Walmart to largely set the tone on multiple fronts and in multiple categories for the Holiday season."

Comparable sales at U.S. stores, excluding fuel, were up 2.7 percent, versus a 1.2 percent increase a year ago, also outpacing analysts' estimates. Wal-Mart said hurricane-related impacts benefited comparable sales by roughly 30 to 50 basis points. And with fuel, total U.S. comparable sales were up 3 percent, versus a 1.1 percent increase a year ago.

Looking to the full year, Wal-Mart is now calling for adjusted earnings per share ranging from $4.38 to $4.46 in fiscal 2018. It previously expected earning $4.30 to $4.40 a share, while analysts had forecast a per-share profit of $4.38.

"We expect top line growth going forward to be led more by comp sales and eCommerce with less emphasis on new units in the U.S.," Chief Financial Officer Brett Biggs said on a prerecorded conference call.

Meantime, all signs point to Wal-Mart being in a retail war with internet giant Amazon.

After acquiring Jet.com, the big-box retailer's online sales have skyrocketed, as Wal-Mart brought other brands including Bonobos, Modcloth and Moosejaw into its portfolio. The company is also expanding curbside grocery pick-up service, beefing up its digital assortment and working with Amazon-rival Google on voice-activated shopping.

One weakness for Wal-Mart has been that its profit margins have dipped slightly due to more aggressive promotions. The retailer has been investing heavily to keep its prices competitive, and operating margins fell to 3.9 percent during the fiscal third quarter, from 4.4 percent a year ago.

"Price investments in certain markets and the mix effects of our growing eCommerce business were the primary contributors to the decline, although the impact from hurricanes in the U.S. was a significant contributor as well," Biggs said.

Heading into the holidays, Wal-Mart plans to invest more in its stores — holding seasonal parties for customers — and offer more merchandise online. Just this week, the company announced a partnership with Lord & Taylor in which Walmart.com will begin selling the department store chain's high-end apparel next spring.

McMillon said Thursday the company is focused on attracting more "premium brands," such as KitchenAid and Bose, to the company's website.

Including Thursday's gains, Wal-Mart shares have climbed more than 40 percent in 2017.