Walmart is firing back.

The biggest retailer in the world will now offer shoppers the option to have their online orders delivered the next day, following Amazon, which on April 25 announced plans to spend $800 million during the second quarter for one-day delivery for all Amazon Prime members.

Walmart said Tuesday it is rolling out next-day delivery in Phoenix, Las Vegas and Southern California over the next few days and will expand it to reach roughly 75% of American consumers by the end of 2019, including 40 of the top 50 major metros.

Amazon hasn't yet detailed a timeline for its own rollout of next-day shipping. But even before its April announcement, the company had offered same-day and two-hour delivery for Prime members in certain markets for certain products and at an additional cost. Amazon's next-day shipping plan expands the number of items and ZIP codes eligible for expedited service.

Walmart isn't disclosing the cost of its latest delivery push. But the company says it has been working on it for quite some time.

In January 2017, Walmart started offering free, two-day shipping for orders totaling more than $35, lowering its minimum purchase threshold from $50. It had already bought Jet.com for $3 billion in 2016 to juice its online business and compete with Amazon. That deal helped it reach shoppers in bigger cities, like New York, in less time.

"We have been working on this for the past several years," Marc Lore, head of Walmart's e-commerce business in the U.S., said about the move toward next-day shipping. "We've been investing ... and now we are in the position to reap the benefits."

To start, next-day delivery will be available for about 220,000 items "most frequently purchased" online, Walmart said, including toys and electronics. The company said it plans to make more items available to ship next day over time. And the option is only free for orders over $35. Amazon, for comparison, has no minimum purchase threshold for free, next-day delivery but requires customers to have a Prime membership, which costs $119 annually.

"This is the future of the Walmart.com supply chain," Lore said. "The more products we add to this experience ... the more profitable the orders will be."

When Amazon made its one-day shipping the new standard for all Prime customers last month it sent shares of Walmart and Target tumbling, as investors worried bricks-and-mortar retailers would now have to spend more money to match the e-commerce giant's steps. Walmart's stock price was up 0.5% in Tuesday's premarket. Amazon shares were 1% higher.

"It's this nebulous thing called the Amazon effect," said John Bonno, managing director in the retail practice at AlixPartners. "I think retailers are so afraid. ... [They're] so nervous that any new service that Amazon offers, retailers feel they need to go through hoops," to match it.