Hewlett-Packard and Terry Gross, the attorney representing the journalists, said the company would donate money to several charities chosen by the journalists as part of the terms of the settlement. They did not say how much.
"The matter has been resolved to the mutual satisfaction of the parties, and we are pleased to put this matter behind us," said Hewlett-Packard spokesman Emma McCulloch.
She said the company was pleased the money would go to charities.
, focused on allegations that Hewlett-Packard hired investigators who impersonated reporters, board members, and employees to obtain private phone records to find the source of leaks to the media in 2005 and 2006.
The two sides have been holding settlement discussions since December 2006, Gross said.
"It was hard fought to get to a resolution," Gross told Reuters.
"I would have expected that they would have taken a tone a long time ago that was basically 'We did wrong. We should make up for it,'" he said.
Editors' note: A separate lawsuit filed against HP by three CNET News.com reporters is still pending in a San Francisco court. Those reporters were not part of this settlement.