Hewlett-Packard Co said it has struck a $1.2 billion deal for Palm Inc , offering a 23 percent premium to expand into the smartphone market.

The news comes after much speculation on Wall Street about who would buy Palm, which once dominated the market but which has been overshadowed by Apple Inc's iPhone, Research in Motion's BlackBerry and phones that use Google Inc's Android software.

In a sign of Palm's struggles, the company on Wednesday slashed expectations for the current quarter, saying slow sales of its products have resulted in low order volumes from phone carriers.

If you saw the guidance Palm just put out, it was clear they had to sell, said Phil Cusick, analyst at Macquarie Research. Given how quickly Palm's business was falling off and how fast their cash was going out the door, they're lucky to get what they got.

Shares of Palm, which is 30 percent owned by private equity firm Elevation Partners, jumped 28 percent to $5.92, above HP's offer in a sign that some investors could be betting on a higher bid.

Under the deal approved by the two companies' boards of directors, HP will pay $5.70 cash per share of Palm, a 23 percent premium to its closing price on Wednesday of $4.63.

Some investment banking sources had thought that Lenovo <0992.HK> was the leading candidate to buy Palm after the U.S. company was rebuffed by other potential Asian buyers including HTC Corp <2498.TW> and Huawei .

Palm now expects fiscal fourth quarter revenue in the range of $90 million to $100 million, compared with its mid-March forecast that revenue would be less than $150 million. It estimated it would end its fiscal fourth quarter with a cash balance of between $350 million and $400 million.

HP already has a smartphone, the iPaq, which runs on Microsoft's Windows mobile platform. But the device has gained little traction in a smartphone market crowded with competitors.

Lawrence Harris, analyst at C.L. King associates, said it would have been risky for HP to ignore the rapidly growing smartphone market.

I would say HP looked around and said, we need to be in this space. Google is here, Apple is here. And there aren't many stand-alone smartphone companies, Harris said. They would be one of the few companies that I think could successfully turn Palm around.

Palm's current chairman and CEO, Jon Rubinstein, is expected to remain with the company, HP said in a statement, adding that it expects the acquisition to close during its third fiscal quarter ending July 31.

Shares of HP fell to $52.35 in extended trading from their New York Stock Exchange close of $52.28.

(Reporting by Gabriel Madway, Sinead Carew, Alexei Oreskovic and Edwin Chan, writing by Tiffany Wu; editing by Carol Bishopric)