Hewlett-Packard Co. on Tuesday posted a better-than-expected profit as it gained market share in personal computers and sold more of its highly profitable ink supplies, sending shares 3.3 percent higher.

The No. 2 PC maker shed 1,600 jobs during the quarter under a cost-cutting plan by Chief Executive Mark Hurd, who started his job just over a year ago. Since then HP has gained PC market share while No. 1 PC maker Dell Inc. has stumbled, and its ability to compete with International Business Machines Corp. has improved.

HP, also the No. 1 printer maker, said net income for its second fiscal quarter, ended April 30, rose 51 percent to $1.46 billion, or 51 cents per share, from $966 million, or 33 cents per share, a year earlier. Revenue rose 4.6 percent to $22.6 billion.

Excluding 3 cents per share in amortization costs, HP said it had a profit of 54 cents per share, beating the average analyst estimate of 49 cents per share, according to Reuters Estimates. Revenue matched expectations.

HP boosted operating profit margins in its personal computer business and in its enterprise storage and servers unit.

The server business did better than expected and printing looked a little better, too, said American Technology Research analyst Shaw Wu.

The company also issued a forecast for the current quarter that was ahead of Wall Street expectations. Historically, the July quarter is often a problematic one for the company.

Mark Hurd is really focused on execution and accountability, said Cindy Shaw, an analyst at Moors & Cabot Capital Markets.

HP said last July that it would slash 14,500 jobs, or about 10 percent of its workforce, Hurd's biggest move to date to reduce costs at HP. With the 1,600 jobs eliminated in the just-completed quarter, total job cuts stand at about 8,100.

HP has gained share in recent quarters in the rough-and-tumble PC industry. Analysts say HP and other rivals of No. 1 PC maker Dell Inc. are paying less for components than they had been, letting them lower prices and gain market share at Dell's expense.

HP is definitely doing better in PCs than Dell, Wu said.

For the current, third quarter, HP said it expects earnings per share before items of 45 cents to 48 cents on revenue of about $21.8 billion. The per-share forecast includes 3 cents in stock-based compensation expense.

Analysts currently expect a profit of 43 cents per share, including stock-based compensation expense, on revenue of $21.7 billion.

This was another solid quarter in the long-term plan and while we clearly have more work to do, we are building a stronger, more competitive HP, Hurd said on a conference call with analysts to discuss the results.

Revenue in its PC business rose 10 percent to $7.0 billion as unit shipments rose 16 percent from a year ago. Operating profit was $248 million, or 3.6 percent of revenue, up from a profit of $147 million, or 2.3 percent of revenue, from the year-earlier period.

Imaging and Printing revenue, which accounts for the majority of HP's operating profit, rose 5 percent to $6.7 billion and supplies revenue rose 10 percent. Operating profit was $1.0 billion, or 15.5 percent of revenue, an increase from a year-ago profit of $814 million, or 12.7 percent of revenue.

Enterprise storage and servers revenue increased 2 percent to $4.3 billion from a year ago and operating profit was $322 million, or 7.5 percent of revenue, up from $180 million, or 4.3 percent of revenue, a year ago.

Shares of HP trade at about 16 times the company's estimated earnings per share for its fiscal year, ending in October, and shares of Dell trade at about 16 times its estimated earnings per share for its fiscal year, ending in January.

Shares of Palo Alto, California-based HP have risen 11 percent so far this year, based on Monday's closing price, compared with a 21 percent decline in shares of Dell.

In extended trade, shares of HP rose to $32.15 after falling 52 cents, or 1.6 percent, to close at $31.11 on the New York Stock Exchange.