The move comes a fortnight after Palm hired bankers to explore several options, including a sale of the company.
HP says Palm’s webOS operating system would “help it expand more aggressively in the fast-growing market for smart phones and connected mobile devices.”
The deal values the company at $1.2bn and is expected to be completed at the end of July.
HP says Palm’s chairman and chief executive, Jon Rubinstein, is expected to remain with the company.
Donna Dubinsky and Jeff Hawkins founded Palm in 1992, and in 1995 it was bought by US Robotics, a modem maker that itself was bought by 3Com in 1997. Palm was spun off again as its own company in 2000.
Palm was the first handset to use the new Palm webOS software, which brought mobile applications together on a multi-tasking platform in a way the iPhone did not.
However, sales for the brands have continued to struggle with new competition from the likes of Apple, Microsoft, Google, HTC and Samsung Mobile.
Palm’s shareholders include U2 frontman Bono, who is a major shareholder through his Elevation Partners private equity firm, which has a 30% stake in the telecoms and IT firm.
Rival phone makers Dell, Taiwan’s HTC and China’s Lenovo were rumoured to have already made offers for Palm
Last year, HP’s chief marketing officer Michael Mendenhall, told Marketing Week that it was aways looking to acquire struggling brands, which it thought would benefit from the brand’s new personal touch.