Dublin, Ireland-based Shire PLC (NASDAQ:SHPG) agreed to acquire Viropharma Incorporated (NASDAQ: VPHM), a maker of drugs for rare diseases, for about $4.2 billion in an all-cash deal, the companies said in a joint statement on Monday.

The Irish pharmaceutical major will pay $50 a share for all outstanding shares of Viropharma -- a 27 percent premium on Friday’s closing price of $39.38. Viropharma is a leading player in the rare-disease pharmaceutical market with products such as Cinryze, which treats a rare genetic autoimmune disease, Hereditary Angioedema, or HAE, and Plenadren, which treats adrenal insufficiency in adults.

Shire, which already has a rare-disease portfolio, with drugs to treat Fabry disease and Gaucher's disease, expects the acquisition “to create a $2 billion rare disease revenue base and delivers further strong growth prospects,” Flemming Ornskov, Shire’s CEO said, in a statement.

The acquisition will provide Shire with access to Viropharma’s product pipeline including Maribavir, for the treatment of cytomegalovirus infection in transplant patients, which is currently in the second phase of testing.

Shire expects annual cost benefits of approximately $150 million by 2015 from the acquisition, the statement said, and the transaction will also help Shire to offer complementary treatments for HAE. Shire's product portfolio includes a drug, Firazyr, to treat acute HAE attacks while Viropharma's Cinryze is a preventive treatment.

Exton, Pa.-based Viropharma generated total worldwide net revenues of $428 million in 2012, and the company expects net revenues in the range of $445 million to $465 million in 2013.

According to reports, a number of companies such as France's Sanofi (EPA:SAN) were interested in buying Viropharma for access to its drug pipeline, which is targeted at treating disorders that affect small groups of people worldwide.

Viropharma's stock closed up 2.74 percent on Friday and was trading up 0.3 percent in pre-market trading on Monday.