Israeli pharmaceutical giant Teva said that it was buying the generic drug business of Allergan for $40.5 billion, consolidating its position as a world leader in generics.
Teva will pay $33.75 billion in cash and offer $6.75 billion of its stock to Allergan, the company said, in a major move that will further shake up a drugs industry that has seen a rash of consolidation.
However, Teva said that it was withdrawing its offer of $40.1 billion for rival Mylan, a US-listed company that moved to the Netherlands a year ago for fiscal reasons.
Mylan had dismissed Teva's bid in April and on Thursday Mylan's independent foundation said it would exercise a call option allowing it buy shares to control half the company to fend off the hostile takeover.
The Allergan transaction was unanimously approved by the boards of directors of both firms, Teva said, and is expected to be finalised in the first quarter of 2016.
Allergan, a US company headquartered in Ireland for tax purposes, is famed for the anti-aging Botox treatment but also makes antibiotics.
Addressing the mega deal for Allergan's generics business, Teva chief executive Erez Vigodman said in a statement: "This acquisition comes at a time when Teva is stronger than ever, in both our generics and speciality businesses."
"This transaction is another step forward on our roadmap to reinforce our already strong position," he added.
"Teva and Allergan Generics share a commitment to innovation, quality, and improving the health of people around the world. Together, the employees of Teva and Allergan Generics will play a critical role ensuring we capture the full potential value resulting from this transaction.
"We look forward to delivering the benefits of this transaction to our stockholders, and better serving patients, customers and healthcare systems throughout the world."
Generic drug companies are under pressure to do deals because there are fewer big-money drugs shifting to generic status compared with a few years ago, when cholesterol medication Lipitor and other blockbusters came off patent, experts say.
The sector also views cost-cutting as a key tool for raising profits as the industry faces rising competition from suppliers in India, a trend which exerts downward pressure on drug prices.
"This transaction will accelerate Allergan's evolution into a branded Growth Pharma leader, enable a sharpened focus on expanding and enhancing our global branded pharmaceutical business and strengthen our financial position to build on our proven track-record of value creation led by effective capital deployment," said Allergan chief executive Brent Saunders.