The tech giant said it made a $1.4 billion profit on sales of $29.1 billion for its fourth fiscal quarter, compared with a $6.8 billion loss on sales of $30 billion in the same period a year ago.

That worked out to earnings of 73 cents a share. Analysts surveyed by Thomson-Reuters generally had expected 75 cents a share on sales of $27.9 billion for the quarter.

"I'm pleased with our progress," CEO Meg Whitman said in a conference call with analysts. Although most of the company's business units saw declining sales for the period, she said HP gained market share in some of those niches.

HP's earnings had exceeded Wall Street's expectations in the three previous quarters, even though its sales slumped in each of those periods.

The storied Palo Alto company offers a wide variety of products, including networking switches, routers, servers, data storage devices, calculators and software. But most of its revenue comes from selling personal computers and printers, which have been losing favor with consumers, who are turning increasingly to smartphones and tablets, and don't print as often as they used to.

Advertisement

HP also has run into trouble and suffered a boardroom shake-up earlier this year because of several major corporate acquisitions that didn't turn out well. After spending $11 billion for British software company Autonomy in 2011, for example, it recently wrote off about $8.8 billion worth of Autonomy's value, saying it was misled about the company's worth.

The Autonomy purchase prompted a federal lawsuit by investors claiming HP was negligent in buying that company. On Tuesday, U.S. District Judge Charles Breyer dismissed the allegations against several people initially listed as defendants in the case, including former HP CEO Leo Apotheker, HP board member Raymond Lane and HP Chief Financial Officer Catherine Lesjak. But the judge kept Whitman and HP as defendants.

Repeatedly cautioning that it will take years to turn around the company, Whitman generally has won praise from analysts since becoming HP's CEO in 2011.

Her efforts to get the company back on track have included cutting expenses, partly by laying off 29,000 employees, and changing many of its top executives. She also has attempted to bring order to the company's diverse product lines by refocusing the firm on several key areas, such as cloud services -- which help businesses operate on the Internet -- cybersecurity and data analysis.

In a recent note to its clients, Wells Fargo Securities said HP's stock "risk/reward is favorable" over the next year or so and J.P. Morgan concluded "there could be upside potential in the next 12-15 months" for HP investors.

Others take a more pessimistic view.

"Overall, we continue to believe all HP's major businesses face structural decline and margin pressure," analysts at Deutsche Bank concluded in a recent note, adding, "we do not see a quick fix for any of these issues."

Similarly, Trip Chowdhry, an analyst with of Global Equities Research, concluded Tuesday that Hewlett-Packard's business "will further deteriorate before it stabilizes."

Contact Steve Johnson at 408-920-5043. Follow him at Twitter.com/steveatmercnews.