Canada's Valeant Pharmaceuticals has agreed to acquire US bowel drugmaker Salix Pharmaceuticals in an all-cash deal, indicating that British pharmaceutical company Shire has withdrawn from a similar attempt.

Valeant will pay about $10.1bn (£6.6bn, €8.9bn) for Salix in the deal, which is approved by the boards of both companies, according to a press release. The transaction has a total enterprise value of about $14.5bn.

Salix, known for its gastrointestinal (GI) drugs, is considering its options in the midst of a management shakeup and inventory issues. It makes drugs to treat ulcerative colitis and travellers' diarrhoea and is nearing approval for a potential treatment of irritable bowel syndrome.

"Salix's market-leading gastrointestinal franchise is an ideal strategic fit for Valeant's diversified portfolio of specialty products," said J Michael Pearson, Valeant CEO.

"With strong brand recognition among specialist GI prescribers, a highly rated specialty sales force, and a significant product and commercial presence across the undertreated and underserved gastrointestinal market, this acquisition offers a compelling opportunity for Valeant to create a strong platform for growth and business development."

The combination is expected to yield more than $500m in annual cost savings within six months, according to the companies.

The transaction is expected to close in the second quarter of 2015, subject to regulatory approval and other conditions.

British drugmaker Shire reportedly took initial steps towards a bid for the US company and was working with advisers on a potential offer.

Other drugmakers such as Takeda Pharmaceutical, AstraZeneca Plc, AbbVie Inc and Endo International Plc were also reportedly interested in acquiring Salix.