Amazon has agreed to buy primary care network One Medical for $3.9 billion in cash.

Amazon said Thursday that it has agreed to buy One Medical at $18 per share, valuing the company at $3.9 billion.

Amazon said in a statement on Thursday that cash transactions for One Medical totaled approximately $3.9 billion, including net debt.

One Medical is a San Francisco-based healthcare organization that provides digital health and inviting.

One Medical was established in 2007, and since then the procurement has also grown rapidly.

Amazon is working to reduce rapidly rising costs, including health benefits, for employers in the healthcare industry.

"Health care experiences need a rethink," said Neil Lindsay, senior vice president of Amazon's Healthcare Push.

Amazon shares were up 1.3% and 1Life Healthcare up 2.6% in Thursday morning trading following the news.