Just a few months after an activist investor started pressuring Whole Foods (NASDAQ:AMZN) to make big changes or consider a sale, the Austin-based grocery chain said Friday it has agreed to be acquired by Amazon (NASDAQ:WFM).

Amazon said it has entered an agreement to purchase Whole Foods at $42 per share, putting the transaction at a value of about $13.7 billion.

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

The deal seems to belie Whole Foods co-founder and CEO John Mackey’s strong desire to keep Whole Foods independent. In a recent Texas Monthly profile, he was quoted as saying this of the activist investors pressuring the company: “These people, they just want to sell Whole Foods Market and make hundreds of millions of dollars, and they have to know that I’m going to resist that,” he was quoted as saying. “That’s my baby. I’m going to protect my kid, and they’ve got to knock Daddy out if they want to take it over.”

But, perhaps this deal was more appealing that what he envisioned when he said that. Under the deal, Whole Foods will still operate under its usual Whole Foods Market brand and Mackey will stay on as CEO. Also, Whole Foods Market’s headquarters will remain here in Austin near Lamar and 6th Street.

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

The deal is expected to close in the second half of 2017.

The news comes just a day after Amazon was said to be considering purchasing Slack, the work-place communications software, for about $9 billion. Even at $9 billion, that would dwarf Amazon’s largest acquisition to-date —  the purchase of Zappos for $1.2 billion in 2009. The acquisition of Whole Foods, of course, would eclipse that.

Whole Foods was founded in Austin in 1978 and now has more than 430 stores. The grocer has long been known for its natural and organic foods, and, more recently, its in-store restaurants and partnership with grocery delivery startup Instacart. Whole Foods signed a five-year deal with Instacart in 2016, and it also invested in the delivery startup. Whole Foods also has partnerships with Google’s delivery service, Google Express, to deliver groceries in some markets. It’s unclear how Amazon’s acquisition of Whole Foods will impact those relationships.

Amazon was said to be considering buying Whole Foods last fall. But that idea seemed to have dissolved as other potential buyers, like Kroger, were floated as potential buyers.

Stock prices for Kroger, Costco and Walmart were all down on news of Amazon’s push into the grocery business. MarketWatch reported nearly $29 billion was removed from the total combined market cap of rivals in the grocery category.