LAVAL, Quebec—Valeant Pharmaceuticals International has entered into an agreement with William Ackman and his Pershing Square Capital Management group that covers the distribution of legal and settlement costs related to a long-running battle with Allergan shareholders, according to a Securities and Exchange Commission filing earlier this week.

Allergan shareholders filed an insider-trading lawsuit against Pershing and Valeant in mid-2015, about a year after Valeant had attempted its unsuccessful takeover of Allergan.

According to the SEC filing, any settlement relating to the Allergan litigation that receives mutual consent of both Valeant and Pershing Square “will be paid 60 percent by the Valeant parties and 40 percent by the Pershing Square parties. The agreement does not provide for any allocation of costs in a settlement that is not consented to by both parties.”

In addition, the filing noted that the first $10 million in legal fees and litigation expenses incurred in connection with the litigation will be shared equally by Valeant and Pershing Square. This agreement between Valeant and Pershing Square expires Nov. 1, 2017, unless it is extended by mutual agreement of both parties, according to the SEC filing.