Amazon just purchased Whole Foods for a cool $13.7 billion Dollars

The $42 per share offer represents a premium of 27 percent to the upmarket grocery chain's Thursday close.

The merger will need approval from shareholders and regulators, but the two companies hope to finalize the deal sometime before the end of the year.

The companies announced on Friday that Amazon will buy Whole Foods for 42 U.S. dollars per share (£32.80), but will continue to operate stores under the Whole Foods brand. The investment firm Jana Partners said in April that it had built up an ownership stake in Whole Foods because it saw ways to address its "chronic underperformance for shareholders". The investors have criticized Whole Foods for its poor performance, and have suggested the chain could be merged with another grocer.

Online has been the next frontier for the grocery business. Whole Foods itself had launched an offshoot chain named after its "365" private label brand in a nod to the popularity of no-frills chains. Jana had pushed to shake up Whole Foods' board of directors, among other changes.

Wal-Mart in the meantime has been growing its e-commerce business with an eye on Amazon, and operates more than 4,000 US stores.

Whole Foods released its most recent earnings report in May.

Mackey will remain CEO of the grocery store chain after the deal closes, and the store will continue to operate under the Whole Foods brand.

Amazon could cut costs if the technology gets good enough to deploy at Whole Foods locations.

Amazon has also been at work on drive-up grocery stores and a convenience store but those concepts could take years to develop. Walmart has touted synergy between physical and virtual retailing capabilities - particularly in food - as a competitive advantage. It also had announced a board shake-up and cost-cutting plan amid pressure from activist investor Jana Partners.

  • Leroy Wright