Amazon.com Inc said on Friday it would buy grocer Whole Foods Market Inc for $13.7 billion in a move that gives the online retailer a physical network of stores to distribute fresh food and other goods to millennials and wealthy consumers.

Amazon, which is known for squeezing suppliers and has been experimenting with its own outlets, will take over a natural and organic grocer pioneer brimming with 456 stores and high-end shoppers but struggling to rein in prices and integrate technology.

The deal sent shockwaves across the food distribution market and beyond. Shares of grocer Kroger Co swooned 11 percent, while Wal-Mart Stores Inc fell 5 percent, signaling fears that Amazon could cut prices and broaden Whole Foods' product mix, turning it into a much broader retailer.[]

Amazon's shares were up 3 percent at $993.40, adding more than $14 billion to its market capitalization.

"Supermarkets will now have to contend with not only competition with each other and non-traditional grocers like Wal-Mart Stores Inc and Target Corp, but with a retailer like Amazon which has the financial capacity to price aggressively," said Mickey Chadha, vice president and senior credit officer at Moody's Investors Service.

"We expect this transaction to further accelerate the consolidation within the supermarket space."

Amazon has agreed to pay $42 per share in cash for Whole Foods, a 27 percent premium on the Austin, Texas-based grocer's closing share price on Thursday. Whole Foods shares were trading just above that level on Friday, as investors saw negligible regulatory risk to the deal closing.

A person familiar with Amazon's strategy said the company believed customers wanted a combination of online and real-world buying options.

Amazon has been looking at stores that could allow traditional in-store purchase, online ordering with on-site pickup, and home delivery, using the store's warehouse as a distribution point.

Still, Amazon is playing catch-up in the grocery business. Wal-Mart Stores Inc already offers in-store pickup. Amazon announced a similar service called AmazonFresh Pickup at two locations. Amazon also has dealt with technology problems at a prototype store inside its corporate office in Seattle, called Amazon Go, where sensors and tech-savvy cameras detect what shoppers pull off the shelves and charge their Amazon accounts when they leave, people familiar with the matter said. That has delayed opening the store to the general public, they added.

And while some analysts expected Amazon to bring vast buying power to Whole Foods, Amazon's heft in the food market is far smaller than in other areas, and high demand for organic products gives farmers unusual bargaining power.

Whole Foods has posted seven straight quarterly sales declines at established stores and had overhauled its board of directors in the face of pressure from activist hedge fund Jana Partners LLC.

"I think that this takes all of the pressure off Whole Foods and gives Whole Foods the opportunity to revitalize that business and, of course, it stems the criticism from all of these activist investors," said Neil Saunders, managing director of GlobalData Retail in New York.

The deal is for $13.4 billion in cash and the remainder in debt.

The acquisition price implies a trailing 12-month price-to-earnings multiple for Whole Foods of 31 times, versus a 14.4 average for the S&P 500 Food Retail index.

Amazon and Whole Foods expect to close the deal during the second half of 2017.

The grocer will continue to operate stores under the Whole Foods Market brand and John Mackey will remain as its chief executive officer, the companies said. Whole Foods' headquarters will still be in Austin.

Eyes on Grocery Shoppers

Amazon, started in Seattle in 1994 by former hedge fund manager Jeff Bezos, has grown into the world's biggest diversified online retailer, with a market capitalization of nearly $500 billion.

It has expanded from a book seller into a merchant of nearly all consumer products, as well as producing videos.

Both Amazon and Whole Foods cater to younger consumers including so-called millennials as well as those who are financially well off.

"Amazon could bring technology to all Whole Foods locations or it could absorb Whole Foods into Amazon Fresh. Either way, it's good for consumers like myself," said Di Wu, a New York resident in her early 30s who is a member of Amazon's Prime fast-shipping service and also shops at Whole Foods at least twice a week.

"Amazon is known to drive down prices and make the shopping experience more efficient," Wu said.

Goldman Sachs Group Inc and Bank of America Corp advised Amazon on the Whole Foods deal and provided bridge financing, while Evercore Partners Inc advised Whole Foods.