Dublin-based pharmaceutical group Shire said Monday that it has agreed to buy US peer Baxalta for $32 billion (29 billion euros) to create a global biotech giant targeting rare diseases.

The agreed cash-and-share offer was an improvement on a previous bid of $30 billion that Baxalta had rejected in August. The transaction is expected to be completed in mid-2016, Shire added in a statement.

The purchase of the Deerfield, Illinois-based group will boost Shire's position in the market for rare-disease treatments in the pharmaceutical sector, which is undergoing rapid consolidation.

Following the deal, Baxalta will benefit from lower taxation because Shire is based in Ireland—which boasts ultra-low corporation tax.

"This proposed combination allows us to realise our vision of building the leading biotechnology company focused on rare diseases," said Shire chief executive Flemming Ornskov.

"Our expanded portfolio and presence in more than 100 countries will drive our growth to over $20 billion in anticipated annual revenues by 2020."

The offer values Baxalta at the equivalent of $45.57 per share, which marked a premium of 37.5 percent above the share price on August 3. That was one day before Shire confirmed its interest in Baxalta.

London-listed Shire forecasts that it will generate more than $500 million in annual cost synergies within three years of the closing of the transaction.

Monday's blockbuster deal comes after Shire snapped up Dyax, a US company that also specialises in rare diseases, for $5.9 billion in November.

Faced with expiring patents and growing competition from generics, pharmaceutical firms like Shire increasingly view so-called orphan drugs—which target rare diseases—as a path to growth.

The latest deal meanwhile "presents a unique opportunity for Baxalta shareholders, who will receive substantial immediate value as well as an ongoing stake in a combined global leader in rare diseases with strong growth prospects", added Baxalta chief executive Ludwig Hantson.

"We bring to Shire a strong portfolio and pipeline of market-leading products, high-quality manufacturing capabilities and a talented global workforce that places patients at the center of everything we do."

The combined Shire-Baxalta group will have a major focus on areas like bleeding disorder hemophilia and immunoglobulin therapy, as well as a growing franchise in oncology.

There are some 7,000 orphan diseases affecting an estimated 25-30 million people around the world, most caused by genetic factors. Experts estimate about 450 orphan treatments are under development.

Earlier transactions driven by orphan remedies included Roche's 2009 acquisition of US company Genentech and the 2014 takeover of Seragon Pharmaceuticals. Pharma giants like Pfizer and GlaxoSmithKline have also moved to fortify their rare disease portfolios.

Treatments for rare diseases accounted for about $20 billion in annual sales in 2000. By 2020, those payments are expected to reach $176 billion, according to an October 2014 report by EvaluatePharma.