Valeant Chairman and CEO J. Michael Pearson said in a statement that his firm "cannot justify to its own shareholders paying a price of $219 or more per share for Allergan."
"This combination will greatly enhance our U.S. and international commercial opportunities," said Paul Bisaro, executive chairman of Actavis.
The combined company of Activis and Allergan will have an expected $23 billion in revenue and will be led by Brent Saunders, CEO and president of Actavis. Bisaro will remain executive chairman, the company said.
"Today's transaction provides Allergan stockholders with substantial and immediate value, as well as the opportunity to participate in the significant upside potential of the combined company," David E. I. Pyott, chairman and CEO of Allergan, said in a statement.
Allergan has spent six months maneuvering against a takeover by Ackman and Valeant, including in a legal battle. Pyott had said shareholders would be hurt because Valeant's cost-cutting, particularly in research and development, would stop its growth, and he questioned Valeant's accounting.
In a conference call following the announcement, Pyott said the decision to accept Actavis' offer was related to similarities between the two companies' commitment to research and development, to which the combined company will dedicate about $1.7 billion annually.
A representative from Pershing Square did not have an immediate comment.
Allergan shares rose as high as 6.6 percent to $211, earning Ackman a payout of more than $2.4 billion on his nearly 10 percent stake in the company.
Reuters contributed to this report.