Johnson & Johnson said Wednesday it would buy robotic surgery firm Auris Health for $3.4 billion in cash.

The purchase gives J&J, one of the world's largest maker of health products, an entry into robotics and builds on the company's partnership with Alphabet's Verily.

"In this new era of health care, we're aiming to simplify surgery, drive efficiency, reduce complications and improve outcomes for patients, ultimately making surgery safer," said Ashley McEvoy, company group chair of consumer medical devices, in a press release. "Collectively, these technologies, together with our market-leading medical implants and solutions, create the foundation of a comprehensive digital ecosystem to help support the surgeon and patient before, during and after surgery."

The company is divided in three main business units: pharmaceuticals, medical devices and consumer products. J&J's medical device business has been lagging, with sales falling 4 percent to $6.67 billion in the fourth quarter of 2018. The health-care company has vowed to improve performance through acquisitions and divestitures.

Last year, J&J divested its LifeScan blood glucose monitor business after exiting the insulin pump market.

Bloomberg reported last month that J&J was pursing an acquisition of Auris Health, a privately held developer of robotic technologies. J&J said Wednesday it's creating a "connected digital ecosystem" that uses data and robotic technology to guide surgeon through procedures and improve patient treatment.

The surgical instruments business is expected to reach more than $12 billion by 2025, with the biggest players in the space including J&J, Medtronic, and Intuitive Surgical.

J&J CEO Alex Gorsky noted in a fourth-quarter earnings call last month that investors would see "continued news about our robotics platform over the course of 2020 and beyond."

"What we want to make sure is that we get out in a timely manner," he said, "but that we're also out in a manner that ensures we're competitive and ensures, ultimately, that we're making an even bigger difference in this area as we go forward."

The transaction is expected to close by the end of the second quarter of 2019.

J&J's stock was slightly higher in premarket trading Wednesday. The stock is up nearly 4 percent since the beginning of this year. Shares are more than 2 percent higher over the last 12 months.

--CNBC's Angelica LaVito contributed to this report.