The world's top personal computer maker, which is in a bidding war with Dell Inc
HP was accused of paying kickbacks to other companies that recommended federal agencies buy its products and the allegations were first brought to light by whistle-blowers in a 2004 lawsuit.
Contractors must deal fairly with the government when doing business with federal agencies, said Tony West, Assistant Attorney General for the Justice Department's civil division.
The settlement also resolves another case involving pricing problems with a 2002 HP contract with the General Services Administration, which handles much of the federal government's procurement.
HP discovered in 2007 that it might have failed to provide complete pricing information during contract negotiations, the Justice Department said.
The company denied any illegal conduct, but decided to settle to get past the matters.
HP denies engaging in any illegal conduct in connection with these matters, the company said in a statement. We believe it is in the best interest of our stakeholders to resolve the matter and move beyond this issue.
(Reporting by Jeremy Pelofsky; editing by Bernard Orr and Andre Grenon)