NEW YORK — J.C. Penney’s largest investor and former board member, William Ackman of Pershing Square Capital Management, is selling his nearly 18 percent stake in the company.The move to sell 39.1 million shares of the company, announced in a regulatory filing late Monday afternoon, comes two weeks after Ackman resigned from J.C. Penney’s board as part of a deal to resolve an unusually public battle between the activist investor and the struggling department store operator. The news sent its shares down another 3 percent to $13 per share in after hours trading, having declined 15 cents to $13.35 in the regular session. The latest development comes as the beleaguered chain is trying to recover from a botched transformation plan spearheaded by its former CEO Ron Johnson that led to disastrous financial results. The board ousted Johnson in April after only 17 months on the job and rehired Mike Ullman, who had been CEO of the retailer from 2004 to 2011. Ackman resigned from the board on Aug. 13 after stating publicly that he’d lost confidence in Penney’s board and that Chairman Thomas Engibous should be replaced. Ackman and the retailer’s board also were bickering over how quickly the company should replace Ullman, who is expected to be an interim CEO. Ackman had joined Penney’s board in February 2011 and pushed to hire Johnson, a mastermind of Apple’s successful stores. The hope was that Johnson could inject new energy into a tired company. But Penney ended up recording nearly $1 billion in losses as revenue plummeted by 25 percent in the first year of the transformation. The financial declines continued into the first and second quarters of the year.In a letter to investors last week, Ackman admitted that the investment in Penney was a “failure” and that retail “has not been our strong suit.” Ackman’s Pershing Square Capital Management invests in and bets against a wide range of businesses, including McDonald’s, insurance company MBIA Inc. and Canadian Pacific Railway. But Ackman has been particularly vocal about his dealings with Penney lately as the department store struggles to turn around its business. In the letter to investors last week, Ackman it was “difficult to determine” how long a sales recovery might take. However, at the time, Ackman did not hint further on what he planned to do with Pershing’s stake in the retailer. Ackman initially purchased shares of J.C. Penney in 2010. According to the prospectus, filed late Monday, Penney will not receive any proceeds from the sale of the shares.