In a day of dramatic developments in the Hewlett-Packard Co. spying scandal, Larry Sonsini sat before a packed House committee for nearly five hours Thursday to answer harsh questions as the board’s main outside counsel.

Sonsini flatly denied that he had any knowledge of the company’s investigation into boardroom leaks until after that probe was finished. Members of the House Energy and Commerce Committee, however, repeatedly pressed Sonsini on why he didn’t raise concerns about the investigation’s unseemly methods when he learned about them in an April report this year.