Hewlett-Packard is buying Palm for nearly $1bn in cash, ending a brief period when it had looked as though the troubled smartphone maker might be bought by rival phone makers HTC or the Chinese computer maker Lenovo.

The $5.70 per share price represents a 23% premium over the price yesterday. Accounting for debt, which HP is also taking on, the transaction has a value of $1.2bn. It is expected to close by the end of July. Last year Palm stock traded at up to $18 - though that is a far cry from its 2000 high of $552.

The deal means that HP can move aggressively into the mobile phone market using Palm's WebOS operating system, and also attack the market for "slate" computers like Apple's iPad, a niche for which sales are expected to grow rapidly this year.

The transaction also means that the uncertainty that has been hanging over Palm - which attempted to break the three-way stranglehold on the smartphone market by Nokia, BlackBerry maker RIM and Apple - is over.

"Palm's innovative operating system provides an ideal platform to expand HP's mobility strategy and create a unique HP experience spanning multiple mobile connected devices," said Todd Bradley, executive vice president, Personal Systems Group, HP. "And, Palm possesses significant IP assets and has a highly skilled team. The smartphone market is large, profitable and rapidly growing, and companies that can provide an integrated device and experience command a higher share. Advances in mobility are offering significant opportunities, and HP intends to be a leader in this market."

The statement notes that Jon Rubenstein, the former Apple executive who was brought in as chief executive at Palm after joining it in October 2007, is expected to remain with the company.

HP has not previously been seen as a player in the mobile phone market. But it has the heft to be able to cut deals with the big phone networks: Palm struggled to get good prices for its Palm Pre and Pixi products, despite enthusiastic reviews. It is reckoned that about 500,000 Pre handsets were sold in the US after its release in 2009.

A key feature that Palm will bring to HP is the WebOS operating system for mobile phones, putting HP into contention with Nokia's Symbian, Google's Android, RIM's BlackBerry, Apple's OSX and Microsoft's Windows Mobile and upcoming Windows Phone.

Palm has been losing share in the smartphone market to Apple and, now, Android.

Elevation Partners, the company which provided repeated investments that in effect kept Palm from going bust, should realise a small profit on the deal. Dan Primack of PEHub, which follows private equity transactions, noted: "Back of envelope math shows Elevation would get $485m from HP/Palm deal. Compared to $460m in. "

Engadget has details of a phone call with HP executives: the suggestion is that HP adds the global reach, while Palm brings the intellectual property.

[the] word is that Palm's existing hardware roadmap is basically untouched at this point by this acquisition, but the good news on the HP end of things is that the company sees WebOS as a "prized asset," and they intend to "scale it across multiple connected devices." That sounds like tablets to us, and HP didn't beat back that assumption. On the Palm hardware end, Jon [Rubenstein] is very fond of saying "scale," referring to the money and manufacturing resources at HP's disposal, but he also says that he sees Palm working hand in hand with HP on devices.