Bill Ackman and his beleaguered Pershing Square Capital Management moved to sell the remaining 6.6% stake it owned in Canadian Pacific Railway  (CP - Get Report) , bringing to a conclusion a five-plus year campaign at the railroad company that had its ups and downs.

The sale, announced late Wednesday, is also the fund's latest effort to unload shares in the wake of losses stemming from large minority investment in embattled Valeant Pharmaceuticals International (VRX) .

Pershing Square and CP issued separate statements addressing the sale. Pershing reported that it had launched a public offering for the remaining 9.8 million CP shares held by the fund. J.P. Morgan Chase & Co.  (JPM - Get Report) , Credit Suisse  (CS - Get Report) , and Bank of America Merrill Lynch  (BAC - Get Report) acted as underwriters for the offering.

The activist in April reported that it had cut its stake in CP to 6.6% from 9.1%. Despite speculation that the sale was driven to help offset losses from Pershing Square's Valeant investment, Ackman said in a press release that the fund intends to use the proceeds of the sale to fund one or more new investments.

In a statement, Ackman (pictured) praised CP CEO Hunter Harrison and President Keith Creel for having "restored to greatness one of North America's top railroads and (they) have set the company on the path to continued success." He added that "Canadian Pacific has completed an incredible transformation" since Pershing's 2011 investment.

Ackman joined CP's board in 2012, according to relationship mapping service BoardEx, a service of TheDeal. He said Wednesday that even with the sale he will continue to serve on CP's board until the next annual meeting, likely in April 2017.

The liquidation suggests that Ackman is no longer going to agitate behind the scenes to push CP into making another major unsolicited bid after the railroad canceled hostile efforts in April to acquire Norfolk Southern (NSC). Ackman had been a major advocate for consolidation in the railroad space, arguing last year that Norfolk was "an ideal activist situation." CP cancelled its hostile bid after key lawmakers raised concerns about the potential deal and after a top Justice Department antitrust chief raised concerns about pre-merger coordination between the two companies.

Nevertheless, the CP investment represents a financial and activism achievement for Ackman and Pershing Square. In 2012, Ackman engineered a board takeover at CP, in a major victory that pushed out the railroad company's CEO, Fred Green and one that was considered a game-changer in Canada because it demonstrated that institutional investors at one of the country's most iconic companies could be receptive to lobbying by an activist.

Pershing had acquired an original 12% CP stake in 2011, at prices ranging from $46.41 a share to $63.52 a share. On Friday, shares were down 2% in after-hours trading and closed Wednesday at $147.28 a share.

The share sale likely has to do, partly, with efforts to try to balance Pershing Square's portfolio, which is struggling with its significant investment in Valeant. The drug company's stock price dropped by more than 50% on one day last year and trades at roughly $22.36 a share -- down from its high of about $262 a share in August 2015.

The stock price drop helped drive Pershing Square, once the darling of the activist investor community, to an abysmal -20.5% return net of fees for 2015. It was down 19% for the year as of July 31.

Pershing Square has also cut stakes in other investments, in the wake of its Valeant investment, raising questions about whether the fund will continue to agitate privately and publicly at those firm.s Last year Pershing Square' accumulated a 7.5% Mondelez International  (MDLZ - Get Report) stake in what was seen by many as an effort to drive the food and beverage company to sell itself. However, Pershing cut its stake in Mondelez to 5.6%, according to a March securities filing. Instead of selling itself, Mondelez launched an unsolicited $23 billion bid to buy Hershey (HSY - Get Report) , which was rejected unanimously by the chocolate company's board in July.