Mylan Inc. on Monday said it has agreed to buy Abbott Laboratories’ specialty generic drug business in developed markets outside the U.S. in a $5.3 billion all-stock deal that would allow Mylan to relocate some of its operations to the Netherlands.

The deal calls for Abbott to carve out the assets of its specialty and generic drug business in Europe, Japan, Canada, Australia and New Zealand and transfer them to a new Netherlands-based public company, which will merge with Mylan to create Mylan N.V. In exchange, Abbott will take a 21 percent stake in the combined company, which will be headed by Mylan’s current leadership. Mylan plans to keep its headquarters in Pittsburgh.