In a long-awaited move into the drug supply chain, Amazon is acquiring the online pharmacy PillPack, the two companies announced Thursday. The news rattled the drug-retail business, sending stocks of CVS, Walgreens, and Rite Aid plunging.

The Boston-based startup PillPack primarily caters to customers who take multiple medications. PillPack streamlines delivery of prescription and over-the-counter medications by pre-sorting them into handy dose packets sent directly to customers’ doors nationwide in monthly supplies. The company boasts that it works with doctors and insurance companies to manage refills and cost coverage on customer's behalf. To do so, it holds pharmacy licenses in all 50 states, developed proprietary pharmaceutical software, and is an in-network pharmacy with most pharmacy benefit managers, including Medicare Part D plans—features that were likely eye-catchers for Amazon.

On its own, PillPack had raised $118 million in funding from venture capital firms and has been valued at $360 million. CNBC reported that it neared $100 million in revenue from 2017, and other reports pegged its customer count around 40,000.

PillPack and Amazon didn’t disclose the terms of their deal, but they said they expect to cement it in the second half of 2018. Bloomberg reported that an unnamed source with knowledge of the matter said that Amazon will pay about $1 billion for PillPack. In April, Walmart was also reportedly considering buying the online pharmacy for a similar amount.

In a statement, Amazon CEO Worldwide Consumer, Jeff Wilke said:

PillPack’s visionary team has a combination of deep pharmacy experience and a focus on technology... PillPack is meaningfully improving its customers’ lives, and we want to help [PillPack] continue making it easy for people to save time, simplify their lives, and feel healthier. We’re excited to see what we can do together on behalf of customers over time.

News of the deal rattled drug retailers, who have long feared Amazon’s entry into their realm. Shares of Walgreens, CVS, and Rite Aid plunged Thursday, collectively losing $12.8 billion, according to CNBC.

On an earnings conference call, Walgreens CEO Stefano Pessina addressed the deal by saying “it is a declaration of intent from Amazon,” according to Bloomberg.

Amazon’s acquisition of PillPack follows a larger—though less defined—move into the healthcare sector for the online giant. Earlier this year, Amazon CEO Jeff Bezos, along with fellow CEOs Warren Buffett of Berkshire Hathaway Inc. and Jamie Dimon of JPMorgan Chase & Co., announced an unnamed venture to tackle healthcare access and costs for their employees. While the details of the company’s efforts remain sketchy, the trio announced last week that surgeon and public health expert Atul Gawande will be its CEO.