Amazon really, really wants to sell you groceries. But starting a new grocery service—especially online—from scratch is hard. It seems, however, Amazon has found a solution: Just buy a well-known chain that already operates nationwide, instead.

Amazon will acquire Whole Foods Market for $13.7 billion in cash, the companies announced today.

Amazon has been desperately trying to break into the grocery business for some time, but that’s proven a difficult nut for the online mega-company to crack. They’ve tried AmazonFresh, Amazon Prime Pantry, and a bunch of other initiatives to get customers to order groceries online, but it’s been slow going. In May, Amazon opened two grocery-pickup stores for the public to use.

More on Food Shopping

Meanwhile, Whole Foods has been facing pressure from activist shareholders to consider selling the company—which, evidently, it has now done.

Bloomberg reported in April that Amazon had been considering buying Whole Foods in 2016, but chose not to at that time.

As we noted then, this purchase is absolutely massive for Amazon: Until now, its biggest acquisition was the $1.2 billion it paid for Zappos back in 2009.

The announcement perhaps explains why Whole Foods CEO John Mackey was so irritated with “greedy bastard” investors earlier this week.

However, in his official press statement about the merger, Mackey sang a much calmer, if not entirely enthusiastic, tune.

“This partnership presents an opportunity to maximize value for Whole Foods Market’s shareholders,” says Mackey, “while at the same time extending our mission and bringing the highest quality, experience, convenience and innovation to our customers.”

Amazon founder and CEO Jeff Bezos added, “Millions of people love Whole Foods Market because they offer the best natural and organic foods, and they make it fun to eat healthy. 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.”