The general counsel of Hewlett-Packard Co. announced her resignation Thursday, shortly before the company's CEO and former chairwoman were expected to tell Congress they had not been advised that HP's spying probe involved illegal tactics.

Ann Baskins had been with HP for 24 years, including the past six as the company's top in-house lawyer. She had been scheduled to testify to a House committee as well, but her attorneys said she would invoke her Fifth Amendment right against self-incrimination and not answer lawmakers' questions.

"Ms. Baskins always believed that the investigative methods that she knew about were lawful, and she took affirmative steps to confirm their legality," her attorneys told the House Energy and Commerce committee in a letter Thursday. "Ms. Baskins repeatedly sought and obtained assurances from a senior HP counsel that the techniques about which she knew were entirely lawful."

Baskins' resignation follows the same decision last week by Chairwoman Patricia Dunn, who along with CEO Mark Hurd was going before the House committee to explain how the company came to obtain information about board members suspected of leaking information to journalists. Two other directors have also resigned.

Baskins managed "worldwide legal matters including patents and licenses, litigation and regulatory compliance," according to her biography on HP's Web site. As corporate secretary, a title she was given in 1999, she was also responsible for shareholders' meetings, "board of directors' formalities," corporate governance and shareholder records, according to her biography.

After joining HP in 1982 as a lawyer, she was named a senior attorney in 1985 and corporate counsel in 1986. She held several other positions before being named general counsel in January 2000. She graduated from Stanford University and earned her law degree at the University of California, Los Angeles.

"Stepping down was a very hard decision for her, but by doing so she has put the interests of HP above her own and that is to be commended," Hurd said in a statement about Baskins' resignation.

"I want to thank Ann for 24 years of outstanding service and devotion to HP. She began her career here shortly after law school and worked her way up to serve as the company's top lawyer, earning along the way a reputation for hard work and integrity."

As part of Baskins' severance, she must forfeit all her restricted HP stock but will take away retirement payments totaling $1.78 million. The agreement also gives Baskins until Nov. 22 to cash in 465,858 HP stock options -- worth $3.66 million as of Wednesday.