AstraZeneca PLC, the second-largest drugmaker in the U.K., said on Wednesday that it would pay up to $2.1 billion in cash and debt to buy the rights to respiratory drugs owned by Spanish group Almirall.

As part of the deal, AstraZeneca will pay an initial $875 million for the respiratory drugs and an additional $1.22 billion if the drugs meet certain development and sales goals. The deal is subject to regulatory approval and is expected to be completed by the end of 2014.