A shareholder lawsuit over Hewlett-Packard Co.'s (HPQ) ill-fated boardroom spying probe added claims of insider trading on Wednesday, alleging that executives sold millions of dollars in stock just before the scandal broke.

The lawsuit, filed in Santa Clara County Superior Court on behalf of all HP shareholders, amended a September claim accusing the top brass at HP of breaching their fiduciary duties and causing substantial harm to the company.

It also consolidated other existing lawsuits within California over the media-leak probe at HP that led to criminal charges against former Chairwoman Patricia Dunn, former ethics chief Kevin Hunsaker and three private detectives — Ronald DeLia, Matthew DePante and Bryan Wagner.

The new filing accuses CEO Mark Hurd and seven other executives of unfairly enriching themselves by selling HP stock worth $41.3 million during the two weeks prior to the scandal becoming public in early September.

It was the busiest period of stock sales by top HP insiders in five years, according to the lawsuit. Most of the sales involved cashing out stock options.

HP has said the sales were proper.

The lawsuit claims executives sold on fears that investors would punish the computer and printer maker upon learning of the dicey tactics used to unmask the source of boardroom leaks to reporters. The tactic, known as "pretexting," involved investigators impersonating directors and journalists to obtain confidential phone records.

The "defendants knew that the market's perception of HP would be significantly damaged when (not if) the market became aware of the full extent of distrust and acrimony among Board members, the outlandish smear campaign tactics the acrimony had spurned, and the illegality of the investigatory tactics being utilized," the lawsuit said.

The lawsuit, which seeks unspecified damages, also claims HP wasted corporate assets and initiated a $6 billion stock buyback in August "to prevent a free-fall in the Company's stock price as the news of the defendants' misconduct reached the market."

HP said in a statement that the lawsuit was baseless and "represents a transparent effort to exploit issues related to HP's recent investigation for personal gain at the expense of HP, its shareholders and its employees. HP will defend itself vigorously."

HP's stock price actually has gone up since the investigation was revealed in a regulatory filing, rising about 8 percent to close Wednesday at $39.39 on the New York Stock Exchange.