A lawyer for the controlling trust of Hershey Foods Corp. told a court Wednesday that Pennsylvania's attorney general is exceeding his authority in seeking to block a sale of the candymaker.

Jack Stover, a lawyer for the Hershey Trust Co., said Attorney General Mike Fisher's attempt to exercise authority over a charitable trust is unprecedented and intrudes on trustees' lawful powers.

Deputy Attorney General Gerald Pappert said his office was within its rights and duties to seek the injunction.

"There is absolutely no support, and in fact the evidence contradicts, that there is a need to sell this company," Pappert said.

The five-judge Commonwealth Court panel did not say when it would rule on whether a lower court's injunction blocking any sale should be lifted.

The $5.9 billion trust, which controls 77 percent of the company's shareholder votes and 31 percent of its common stock, announced July 25 that it had ordered Hershey Foods executives to seek bids on its stake.

The trust, which funds the Milton Hershey School for disadvantaged youth, said it was looking to protect its investments against the possibility that the company's finances should ever falter.

The potential sale has sparked protests from the public and politicians, who say a sale could trigger plant closings and layoffs that could devastate the Hershey area.