HP reported first-quarter revenue of $28.4 billion, down from $30 billion a year earlier but above Wall Street's forecast of $27.79 billion. Excluding items, it earned 82 cents a share, down from 92 cents but well above the consensus estimate of 71 cents. Earnings also surpassed HP's forecast of 68 cents to 71 cents.

Profit was "driven by improved execution, improvement in our channel and go-to-market efforts and the impact of the restructuring program we announced in May 2012," CEO Meg Whitman said in a statement. "While there's still a lot of work to do to generate the kind of growth we want to see, our turnaround is starting to gain traction as a result of the actions we took in 2012 to lay the foundation for HP's future."

For the second quarter, HP expects earnings, excluding items, of 80 cents to 82 cents a share. Analysts surveyed by Thomson Reuters were looking for earnings of 77 cents. The Palo Alto, Calif.-based firm predicts full-year earnings of $3.40 to $3.60 a share, well above Wall Street's estimate of $3.32.

"Our primary focus is to deliver on the full-year outlook, and I feel good about the rest of the year," Whitman said. "We'll be bringing a number of new programs and disruptive innovations to market in the coming quarters, and we expect the benefits from our restructuring will accelerate through fiscal 2013."

HP is still in the throes of a major restructuring effort as Whitman attempts to get the troubled tech giant back on track.

"Fiscal 2013 is the second year in a multi-year journey to turn HP around," the CEO said on the call. "The restructuring program had a meaningful impact on the bottom line in the first quarter, and we expect that that will accelerate as we move through fiscal 2013. If I had to characterize it, I would say that the patient showed some improvement."

Investors responded by pushing up HP's shares by 4.68% to $17.90 in extended trading.

Whitman was also quizzed about a possible breakup of HP during the conference call, but she reiterated her aim to keep the company intact.

"We have no plans to break up the company, and I have said many times that I feel we're greater and stronger together," she said in response to an analyst's question. "Importantly, customers want this company to be together."

HP's total cash at the end of the quarter was $13.1 billion. "This was a strong quarterly performance from us in what is normally a seasonally weaker cash flow quarter," Lesjak said.