Walmart sent an encouraging signal to Wall Street Thursday that it's heading in the right direction.

The world's biggest retailer said online sales jumped 33% last quarter. In February, Walmart's stock had its worst day in 30 years after it told Wall Street that digital sales grew 23%.

Walmart is playing the long game, and CEO Doug McMillon is slogging ahead to refit the behemoth for the digital era.

Related: What is Walmart's global plan?

Two years ago, McMillon said Walmart's online sales growth was "too slow." He embarked on an aggressive new strategy to move Walmart away from its brick-and-mortar orgins and turn it into an agile digital player that can compete against Amazon for dollars online.

McMillon has told Wall Street that Walmart wants to become a top destination for younger shoppers. Walmart has "a bit of a longer-term point of view beyond three to five years as it relates to setting the company up for growth and profits in the future," he repeated to analysts in February.

Investors initially bought into the strategy, but they're getting impatient. Walmart's (WMT) stock is down 13% on slower-than-expected online sales growth for the last three months of 2017. Investors also gave a $16 billion deal for Indian online retailer Flipkart an icy response.

"It's a really big ship to turn," said Laura Kennedy, a director at Kantar Retail. "McMillon has said there are very few retailers that have been able to span multiple generations and remain relevant. They don't want to be K-Mart."

Walmart's repositioning pains come as Amazon (AMZN), its biggest threat, bulldozes into new markets and captures Prime members. Amazon's stock is up 35% this year and rivals Costco (COST) and Target (TGT) have also gained ground.

Related: Amazon made Prime indispensable - here's how

Walmart is somewhat immune to day-to-day stock pressure because it doesn't answer solely to Wall Street. Late founder Sam Walton's family owns a majority stake in the company.

After decades of dominating shopping in rural and suburban areas -— 90% of Americans live within 10 miles of one of Walmart's nearly 4,800 stores — the company has gone on a shopping spree to broaden its reach.

"No market is infinite," said Paula Rosenblum, managing partner at Retail Systems Research. "The Street has a hard time understanding that."

Walmart began by acquiring online exchange Jet.com for more than $3 billion in 2016 and tapped the founder, Marc Lore, to run its US e-commerce operation.

Related: 15 questions with Marc Lore

Since then, Walmart has scooped up native online fashion, apparel and home decor brands ModCloth, Bonobos, Moosejaw and Hayneedle and built out its private-label collection. It acquired Parcel, a logistics startup that provides same-day delivery for online purchases in New York. On Wednesday, Walmart announced a partnership with department chain Lord & Taylor for an online store on Walmart's website.

"Walmart is the only firm that has the management, capital and the scale to compete with Amazon," said Scott Galloway, a marketing professor at NYU's Stern School of Business. "They've probably done as good a job of getting off their heels and on their toes as any retailer in the world."

It probably isn't done scooping up niche brands — McMillion told analysts last month that the company has "an appetite for acquisitions."

But Walmart has a cachet problem among many of the wealthier, urban shoppers it is courting in the United States. So the company is trying to clean up its image.

Related: Meet the new Walmart customer: Higher-end and digital-savvy

In a new website redesign, Walmart played down its name and traditional bright blue colors to create "a cleaner and more modern digital shopping experience," Lore said. It has purposefully not branded any of its new fashion companies with the Walmart name. And the company is remodeling stores and tightening demands on suppliers to ensure items are always in stock and on the shelves.

It also raised its minimum wage to $11 an hour and handed out one-time cash bonuses to employees.

Walmart is reportedly considering a deal with health insurer Humana that would give it a greater clout in health and wellness and an access point to more than 14 million Humana policyholders.

A Humana partnership could become another piece in McMillon's focus on creating a more attractive in-store experience to squeeze additional purchases out of shoppers.

Related: Why Walmart may want to buy Humana

It has reshuffled its strategy overseas, too. Walmart took a minority stake in online retailer JD.com in China two years ago. It retrenched a mature UK market by selling control of supermarket chain Asda and recently paid $16 billion for Flipkart in India, the largest deal in its history. It will take years for Flipkart to become profitable, but Walmart believes it can tap into India's $200 billion online market.

But some analysts worry that Walmart's focus on less profitable ventures online and overseas are distracting the company from its core mission — selling groceries, day-to-day essentials and clothes to masses of Americans.

"I think Flipkart is a waste of capital. They have a very poor track record of investing overseas. They're just bringing a checkbook," said Scott Mushkin, an analyst at Wolfe Research. "The desire to grow in e-commerce and India will drain the organization slowly of profits."

Ultimately, Walmart's ability to fight Amazon will come down to leveraging US physical stores with its new online capabilities — what analysts often call "bricks and clicks."

Customers that shop Walmart both through stores and online spend nearly twice as much as those who only make purchases in stores, McMillon says. Walmart hopes to use its physical proximity to Americans and low prices to build awareness of its digital businesses and lock customers into an Amazon-like Prime ecosystem.

Online grocery delivery in the United States has been slow to take off, but it is expected to become ground zero in the Walmart-Amazon battle.

Groceries are Walmart's backbone, accounting for more than half of its $500 billion in sales. Amazon's acquisition of Whole Foods last year and its expansion of grocery delivery and Prime discounts at Whole Foods will test Walmart's hold on the industry. Amazon announced on Wednesday that it was offering Prime members an additional 10% off sale items when they shop at Whole Foods.

Walmart's stores give it a leg up in the race, according to Cowen analyst Oliver Chen. The company has more than 1,100 online grocery pickup locations, a free service where customers can order groceries and drive to pick them up. Encouraging pickup will help Walmart avoid expensive grocery shipping costs.

—CNNMoney's Paul R. La Monica and Chris Isidore contributed to this story.