LONDON — Endo International said on Monday that it had agreed to buy the privately held Par Pharmaceutical Holdings for $8.05 billion in cash and shares.

The deal would create a specialty pharmaceutical company that would be one of the five largest generic drug makers based on sales in the United States, Endo said. Par shareholders would receive $6.5 billion in cash and 18 million Endo shares worth about $1.55 billion.

Par, whose generic drugs include versions of Bristol-Myers Squibb’s Baraclude, a hepatitis B treatment, also makes branded drugs like Megace ES, a treatment for anorexia, and Nascobal, for vitamin B12 deficiency.

Endo makes the painkiller Percocet and Stendra, an erectile dysfunction treatment, as well as generic pharmaceuticals and over-the-counter drugs and medical equipment.