The Dublin-based drugmaker said Monday it will pay $50 for each share of ViroPharma, which is based in Exton, Pa. That represents a 27 percent premium on the U.S. company's closing price Friday, the last trading day before the deal was announced.

Shares of ViroPharma soared before markets opened and after the deal was announced, while Shire's U.S.-traded stock also climbed.

ViroPharma focuses on serious diseases with few, if any, available therapies. Its products include Cinryze, which is used to prevent and treat attacks of hereditary angioedema, a rare genetic disorder that can cause dangerous swelling of the throat or larynx.

ViroPharma said last month that U.S. sales of Cinryze, which accounts for most of its revenue, climbed 22 percent in the third quarter to $102.2 million. It expects North American sales for the treatment to total $405 million this year.

Shire said Cinryze will act as a complement to one if its drugs, Firazyr, which treats acute hereditary angioedema attacks.

ViroPharma also is developing maribavir, a potential treatment for a virus that can lead to serious disease or death in people with compromised immune systems. The experimental drug has received an orphan drug designation from both European and U.S. regulators. That could lead to market exclusivity if the drug is approved.

The companies expect the deal to close by the end of this year, next year's first quarter or soon after that.

ViroPharma shares soared nearly 26 percent, or $10.19, to $49.57 Monday in premarket trading. The stock has more than doubled after closing 2012 at $22.76.