Amazon said Friday it has agreed to buy Whole Foods Market for $13.7 billion, a stunning move to boost its growing grocery business.

The Seattle-based online retail giant will pay $42 per share in an all-cash deal. That's 27% higher than Whole Foods' Thursday closing stock price of $33.06.

“Millions of people love Whole Foods Market because they offer the best natural and organic foods, and they make it fun to eat healthy,” said Jeff Bezos, Amazon founder and CEO. “Whole Foods Market has been satisfying, delighting and nourishing customers for nearly four decades – they’re doing an amazing job and we want that to continue.”

Shares of Amazon rose 1.5% to $978.88 in pre-market trading.

John Mackey, Whole Foods Market co-founder and CEO, said the he agreed to the deal because it is "an opportunity to maximize value" for the company's shareholders. He will remain the company's CEO.

Whole Foods Market will keep its brand name and the headquarters will remain in Austin.