Shares of Hewlett-Packard Co. (NYSE: HPQ), the No. 1 computer maker, rose about 3 percent to $21.77 on Thursday, following the announcement it would fire 27,000 employees by 2014.

Earlier, shares of HP, based in Palo Alto, Calif., rose as high as $22.68, or 7.4 percent, on the news announced Wednesday night by CEO Margaret (Meg) Whitman, who wielded her ax for the first time since becoming CEO last September.

Analysts generally approved the move, suggesting HP would cut costs, narrow its focus and better compete against smaller rival, International Business Machines Corp. (NYSE: IBM). Shares of IBM fell 3 cents to $196.09.