Hewlett-Packard won the bidding war to buy Palm for $1.2 billion. But a new filing reveals that the courtship was a frenzied affair with serious offers from five companies.

Palm said in its latest statement to shareholders that it realized it needed to do something about its sagging sales in early February. On Feb. 17, Palm chief executive Jon Rubenstein organized a committee to explore options. From Feb. 25 to April 1, Palm contacted 16 companies about a possible deal, which could have been anything from licensing Palm’s WebOS operating system to a sale of the company.

Five companies made offers, but the filing only identifies HP. (The only other bidder named was Lenovo). Palm was most interested in offers from HP and two other companies, while the last two wanted to license Palm’s patents. In early March, Palm’s board decided a sale was the best option. HP made its first actual offer on April 13 for $4.75 a share for $1 billion. It asked for 30 days of exclusive negotiations. A second company offered $600 million in cash, and a third company offered a stock deal that would take longer to complete than the other deals.

Palm told HP it would not give an exclusive negotiating period unless HP improved its offer. HP declined. Palm told the other two companies that their bids were not competitive and those companies dropped out. A fourth company then offered $6 to $7 per share with a transaction to take place within 14 days.

On April 18, Palm sent both HP and that fourth company a draft of merger agreements. HP and Palm executives met starting April 20 and HP increased its offer to $5 a share on April 22. Then the fourth bidder dropped its offer to $5.50 a share with provisions that included a $60 million penalty if the deal did not go through. Palm and the fourth bigger tried to work out a deal from April 23 to April 25, to no avail.

Rubinstein told HP on April 24 that its offer wasn’t competitive and that it had to “significantly and immediately” improve its offer to stay in the bidding. HP raised its offer to the winning $5.70 a share bid that day. Rubinstein told the fourth company that he had a better offer on April 25. That company responded by telling Palm it would offer to buy its patents and take a non-exclusive license on WebOS for $800 million.

Palm’s board considered that offer and turned it down. Then HP and Palm entered into negotiations from April 24 to April 28. On April 28, the merger was announced.