The suit, which also names Ackman’s Pershing Square hedge fund and pharma giant Valeant — Ackman’s partner in a $53 billion attempt to take over Allergan — demands the hedge fund investor give back the Allergan stock he owns.

But Allergan claims that the duo was plotting a hostile takeover of Allergan all along — thus violating a securities rule banning insider trading in tender offers.

If successful, the suit would put the kibosh on the deal.

At the very least, it could slow it down.

Calling the lawsuit “baseless,” Ackman said it is merely a “shameless attempt” to delay the special shareholders meeting Pershing Square is calling to replace six members of Allergan’s board.

Ackman expects by mid-August to have lined up the 25 percent of shareholders needed to call the meeting.

To be sure, Valeant’s offer for Allergan has been controversial from Day 1.

The serial acquirer announced its interest in buying Allergan on April 22, the same day Ackman disclosed a 9.7 percent stake in the company.

The bold activist acknowledged knowing of Valeant’s interest in Allergan when he was building his stake. Ackman said he consulted his lawyers, including former SEC enforcement chief Robert Khuzami, who assured him his moves did not violate insider trading laws.

Other lawyers also said Ackman’s actions appeared perfectly legal — as much as they hated to admit it.

One of those legal eagles, Martin Lipton, the famed corporate lawyer Allergan has hired to defend against the Valeant bid, wrote on April 25 that both Ackman and Valeant “took express pains” to sidestep any regulatory issues.

Indeed, Valeant and Pershing Square said in regulatory filings that “No steps have been taken towards” a tender offer.

Allergan believes that was a ruse, with its case seeming to hinge on a statement Valeant CEO Michael Pearson made on June 17.

On that day, Pearson said “he was ‘correct’ in his initial suspicion that Valeant ‘would ultimately have to go directly to Allergan shareholders.’ ”

But the Botox maker needs more than Pearson’s hunch to make the case stick.

The securities rule Allergan claims is being violated says “substantial step or steps … to commence a tender offer” are required before insider trading regs are violated.