Generic drugmaker Actavis Plc (ACT) has won U.S. approval to buy specialty pharmaceuticals company Forest Laboratories (FRX) on condition it sell or relinquish the rights to four generic medicines, the Federal Trade Commission said on Monday.

The deal was valued at about $25 billion when it was announced in February.

The companies have agreed to relinquish their right to diltiazem hydrochloride extended release capsules, which are used to treat hypertension and some anginas.

They also agreed to sell three medicines - ursodiol tablets used to treat cirrhosis of the liver, propranolol hydrochloride extended release capsules used to treat hypertension, and lamotrigine orally disintegrating tablets used to prevent seizures.

Shareholders of both companies have already approved the proposed transaction.

Dublin-based Actavis, whose biggest competitors include Teva Pharmaceuticals Industries and Mylan, has recently been acquiring specialty branded drug makers to boost profit margins and sales.

Forest, which acquired privately held drugmaker Aptalis in January for $2.9 billion, faces a patent cliff on several of its biggest drugs, including Alzheimer's treatment Namenda. It recently won antitrust approval to buy Furiex Pharmaceuticals Inc in a transaction worth about $1.46 billion.

Actavis shares closed at $194.88, down 22 cents, and Forest Labs closed at $88.57, down 77 cents, in U.S. trading. 

(Reporting by Diane Bartz; Editing by Ros Krasny, Sandra Maler and Peter Cooney)