Novartis has agreed to take full control of eyecare company Alcon in a deal worth nearly $40bn. It will spend $28.1bn on raising its stake in Alcon to 77%, up from the 25% stake it bought from Nestle in 2008.

Novartis then plans to spend a further $11.2bn on buying the remaining 23% stake it does not own in Alcon.

The acquisition is expected to help Novartis diversify its business away from prescription drugs. The move also ends uncertainty over whether Novartis would buy Nestle’s majority stake in Alcon outright.

Several of the large drugs companies have been eyeing acquisitions in other areas of healthcare as they begin losing patent protection of their own drugs.