SEATTLE - Amazon is buying Whole Foods for $13.7 billion, the online retailer said Friday.

The deal values the grocer at $42 a share.

Whole Foods had been under pressure from investor Jana Partners, a hedge fund that lobbied for the high-end grocer to seek a buyer to reverse declining share price. Shares had been trading at about $33 Thursday.

"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," Whole Foods CEO John Mackey said in a release.