NEW YORK — J.C. Penney’s biggest investor is selling his entire stake in the struggling company for about $504.4 million, $470 million less than what he paid for it.

The move comes two weeks after William Ackman resigned from J.C. Penney Co.’s board as part of a deal to resolve an unusually public battle between the activist investor and the retailer.

Pershing Square Capital Management’s Ackman disclosed in a regulatory filing late Monday that he was going to sell his nearly 18 percent interest — or 39.1 million shares.

On Tuesday, Ackman said that the shares will be priced at $12.90 each, about 3 percent below Monday’s $13.35 closing price.

The news sent J.C. Penney shares up 47 cents, or 3.5 percent, to $13.82 in midday trading Tuesday.

Ackman acquired the J.C. Penney shares in 2010. He paid about $25 per share, Pershing said Tuesday.

J.C. Penney’s shares have lost nearly 70 percent of their value since early February 2012.