The biggest coffee chain in America is buying Whole Foods for $1.8 billion

The largest coffee chain is buying the nation’s largest grocery chain for $4.5 billion, a deal that will allow it to buy the nation.

Starbucks, which has been expanding its offerings into groceries, has already bought Whole Foods Market Inc. and will buy the second-largest grocery chain, Costco Wholesale Corp., for $7.9 billion, according to a person familiar with the transaction.

The deal is expected to close by the end of the year.

The transaction was announced Wednesday, just hours before Starbucks closed its annual shareholder meeting.

The deal is one of the largest mergers in U.S. history.

Shares of Whole Foods fell as much as 2.5% after the announcement.

The company reported net income of $3.6 billion, or 78 cents per share, for the fourth quarter, compared with $3 billion, 84 cents per, for its same quarter a year earlier.

Shares rose 2.9% after closing at $24.35.

Costco said its earnings per share rose 12 cents to $2.08, compared to a loss of 12 cents per cent for the same period a year ago.

It said it would cut $1 billion in costs.

Whole Foods has about 2.3 million employees and about 1.4 million grocery and pharmacy customers.

It has more than 2.1 million locations, making it the nation “largest grocery retailer,” according to the company.

Wholesale is part of Whole Food, the second chain to become part of Starbucks.

The retailer also is acquiring Target, which owns TJX Corp. The purchase is expected give Starbucks greater clout in the grocery sector.

Starbucks and Whole Foods did not disclose the total value of the deal.