AbbVie is to buy Pharmacyclics for about $21 billion, giving it access to what is expected to be one of the world's top-selling cancer drugs and expanding its reach in the profitable oncology field. 

The deal is the latest example of a big drugmaker swooping on a biotech firm to refill its medicine pipeline.

It also confounds expectations that Pharmacyclics would sell out to Johnson & Johnson. 

AbbVie will pay $261.25 per share in cash and stock, a 13% premium to Pharmacyclics stock's closing price yesterday. The company's shares had dipped below $1 in 2008 and 2009. 

The acquisition lessens AbbVie's dependence on its blockbuster rheumatoid arthritis drug Humira that accounts for most of its revenue but is expected to start to see sales decline from 2017 or 2018. 

AbbVie failed last October to buy Shire for $55 billion after the US took steps to deter such tax-lowering deals. 

Pharmacyclics expects US sales of its blood cancer treatment Imbruvica to hit $1 billion this year and by 2020 worldwide sales are forecast to reach $5.8 billion, according to consensus analyst estimates compiled by Thomson Reuters.

 AbbVie, which was spun out of Abbott Laboratories in 2013, said the deal would be "highly accretive" to its revenue and earnings by 2017. 

California-based Pharmacyclics co-markets Imbruvica with Johnson & Johnson. Besides Imbruvica, it has three product candidates in development. 

Media reports had said J&J was close to buying Pharmacyclics. Novartis was also interested in the company. 

The acquisition is the latest in a spate of big pharma deals this year as many companies are strengthening their portfolios as old drugs go generic. 

Last month, Pfizer agreed to buy Hospira for about $15 billion, and Canada's Valeant Pharmaceuticals International agreed to buy Salix Pharmaceuticals for about $10 billion.