Shares of online food delivery services GrubHub and Waitr Holdings jumped Tuesday after Amazon said it was shutting down its four-year-old rival service, which delivered restaurant meals to Prime members' doorsteps.

Grubhub shares, which have a market value of $6.3 billion, gained more than 7% on Tuesday, while shares of smaller rival Waitr gained 3%. Waitr has a market cap of $482.7 million. Uber, which operates Uber Eats, saw its stock, which is valued at $71.5 billion, rise less than 1%.

Amazon said Monday that it shuttering Amazon Restaurants on June 24. The service had operated in more than 20 U.S. cities. An expansion into the U.K. was closed late last year.

"A small fraction of Amazon employees are affected by this decision, and many of those affected have already found new roles at Amazon," the company said in a statement. "Employees will be offered personalized support to find a new role within, or outside of, the company."

Jeremy Scott, an analyst at Mizuho Group who focuses on the restaurant industry, sees Amazon's decision as part of an expected wave of consolidation in the food delivery industry, which he said could support two to three players at maximum.

The move does not, however, mean that Amazon is leaving the food delivery industry entirely, he added. The company purchased a stake in UK-based food delivery service Deliveroo in May, which Scott sees as an indication that Amazon may plan to enter the industry by acquiring established delivery services, rather than building its own.

The Amazon Restaurant service was "not a reflection of what they're aiming to do," he said.

In a research note, Cowen and Company analyst Thomas Champion said that the Deliveroo investment indicates Amazon "retains some commitment to the space."

Amazon's closure of Amazon Restaurants is good news for GrubHub, according to Scott.

It both eliminates the "existential threat of Amazon" in the short term and sets up Amazon to potentially seek to acquire GrubHub "down the road should they want to take a leap step into the market," he said. He added that GrubHub would be comparatively cheaper to acquire than some of its competitors in the industry.

Amazon's decision is "a modest positive" for GrubHub's shares and for GrubHub and other providers, to which Amazon orders will migrate, Champion added.

"The move is not terribly surprising given Restaurants never appeared to be a major priority for [Amazon]," he said. "In several years of operation, Restaurants had mixed traction, capturing single-digit market share in most markets."

News that Amazon was closing the service was first reported by GeekWire.