(Reuters) - Walmart Inc's WMT.N online grocery delivery partnerships with ride-hailing services Uber and Lyft have ended, according to two sources, a potential setback for the retailer's ambitions to challenge Amazon.com Inc AMZN.O head-on with speedy delivery of groceries to people's homes.

The end of the Walmart partnerships, which has not been previously reported and was confirmed by Walmart and Uber, undercuts a vision the ride-hailing companies laid out: a service that can efficiently deliver anything on-demand, including people and cargo, at the touch of a smartphone app.

“It is incredibly hard to deliver people and packages together,” said a source with a delivery company that works with Walmart and has direct knowledge of the matter. “They are two completely different business models.”

The decision marks an abrupt end to a business relationship that Walmart and Uber announced with much fanfare less than two years ago. At Walmart's shareholders meeting in June 2016, CEO Doug McMillon touted the company's investments in technology and spoke about the partnerships in front of a cheering crowd of 14,000 employees. goo.gl/xJdN2e

Soon after, Uber’s grocery delivery service was launched and expanded to four markets. As recently as March, just before Uber ended the arrangement, Walmart said Uber would be a partner in its plans to deliver groceries to more than 40 percent of the country.

“There was clearly some lack of communication there,” said one of the sources with knowledge of the partnerships ending.

Walmart spokeswoman Molly Blakeman confirmed the end of the tie-ups when asked by Reuters, but did not detail the reasons behind the decision. She said Walmart will use other delivery service providers in the four markets where it had previously used Uber.

“Customers shouldn’t notice any difference as the transition takes place,” said Blakeman, who added that the partnership with Lyft never expanded beyond the initial test market of Denver.

Blakeman said the end of the partnerships will not impact Walmart’s plans to scale grocery delivery as they are not tied to any single provider.

Uber put a stop to the grocery partnership when it informed Walmart in March that it would cease delivery operations on June 30, Uber spokeswoman Ellen Cohn told Reuters. The retailer was Uber’s largest partner for its ‘Rush’ service, which delivered groceries as well as clothes, flowers and other goods.

Uber will shutter the entire Rush program at the end of next month.

FILE PHOTO: A customer pushes a shopping cart at a Walmart store in Chicago, Illinois, U.S. November 23, 2016. REUTERS/Kamil Krzaczynski/File Photo

“We are coordinating with Walmart to make this change as seamless as possible,” Cohn said.

Lyft declined comment and deferred to Walmart on the issue.

For Walmart, which is the country’s largest grocer and gets 56 percent revenue from groceries, the partnerships offered a fast solution to expand its online grocery offerings and improve overall revenue from internet shoppers.

For example, Walmart delivers groceries in China through a partnership with ecommerce company JD.com Inc JD.O, and in Japan through an alliance with Rakuten.

But the retailer was recently punished for its fourth-quarter online sales performance, which investors say is key to the company’s future.

LAST-MILE COMPETITION

Last-mile delivery of packages is an intensely competitive business, with companies ranging from Amazon to United Parcel Services Inc UPS.N, FedEx Corp FDX.N and the U.S. Postal service, as well as startups like Instacart and Deliv, vying for a share.

Since the dot-com boom, companies have tried to crack the business model for online grocery delivery. The rush to solve the technological and logistical challenges has gotten even more frenzied since Amazon acquired high-end grocery chain Whole Foods Market Inc for $13.7 billion last year, a deal that has intensified competition in the sector.

Former Uber Chief Executive Travis Kalanick touted the idea of carrying a person in the backseat and a bag of groceries in the trunk as the ultimate cash-generating transportation service in a smart-phone era.

The delivery service marked the first time Uber publicly committed to a business outside of ride-hailing that was supposed to be meaningful to its bottom line and support its stratospheric valuation, although the private company never offered exact dollar projections.

But startup investors and experts in on-demand delivery say there is a much different set of logistical and economic challenges for moving around cargo than people, requiring a single company to be proficient in two distinct business models.

Uber’s Cohn said Rush was “an experiment” and the company has turned its focus and resources to UberEats, a restaurant delivery service that in the fourth quarter last year generated $1.1 billion, or about 10 percent of Uber’s overall revenue.

NEW PARTNERS

Walmart has added startups Deliv, Postmates and DoorDash to its list of delivery partners. These companies have the singular business of delivering goods, not people, and drivers have more experience safely transporting perishables.

It remains unclear if these startups will step in and replace Uber in the various markets they served.

A particular challenge for companies such as Postmates, however, will be offering rush delivery in suburban and rural areas, where most Walmart stores are located. Such startups have been most successful in urban centers, where there is a high density of customers and couriers can use bicycles or walk to deliver multiple packages in one trip.

“Density has been a challenge historically for all types of delivery companies, all the way back to the Pony Express,” said Ben Narasin, a partner at venture capitalist firm NEA who has been critical of the on-demand delivery business model. “The reality is that the far-away drives will likely be subsidized.”