Hewlett-Packard Co. (HPQ) Tuesday posted a higher quarterly profit as the No. 2 computer maker saw revenue rise across all its businesses, but its profit forecast for the current quarter was on the low end of Wall Street estimates.

Shares rose more than 3 percent in after-hours trade.

HP reported net income of $966 million, or 33 cents a share, for its fiscal second quarter ended April 30, compared with $884 million, or 29 cents a share, a year ago.

Revenue rose 7.2 percent to $21.6 billion from $20.1 billion.

Excluding items, HP said it had a profit of 37 cents a share, a penny ahead of the average estimate.

Analysts on average had expected the company to earn in a range of 34 cents to 37 cents, on revenue of $21.4 billion, according to Reuters Estimates.

"All things considered I think it was an OK quarter," said Shawn Campbell of Campbell Asset Management, which owns HP shares. Referring to an earnings miss by rival Lexmark International Inc. , he added, "Considering what Lexmark (LXK) did, I consider this a win for (HP CEO Mark) Hurd and Hewlett-Packard."

HP's own forecast for its second quarter had called for earnings before items of 35 cents to 37 cents a share on revenue of $21.2 billion to $21.6 billion.

For the current quarter, HP forecast revenue of $20.3 billion to $20.7 billion and earnings per share before items of 29 cents to 31 cents.

Analysts on average expect HP's third-quarter profit to be 32 cents, on revenue of $20.4 billion.

Shares of HP, based in Palo Alto, Calif., rose 54 cents to close at $21.55 on the New York Stock Exchange (search) on Tuesday. They rose further to $22.30 in after-hours trading on the Inet electronic brokerage. For the year to date the stock is down about 2 percent.