Sales in the quarter rose 13% to $25.53bn as demand for personal computers, including laptops and servers soared.
In its lucrative imaging and printing group, revenues also rose 6% to $7.2bn.
'Amazing turnaround'
The results would have surprised analysts had the California-based company not been forced to lift its earnings forecasts last week after financial details were inadvertently leaked through an email from an employee.
"These guys have put together an amazing turnaround of a company that was pretty screwed up and is now moving in the right direction," said Daniel Renouard, senior research analyst for Robert W Baird & Co.
Last year, HP overtook Dell to become the biggest seller of personal computers.
The company has also sailed past IBM as the world's largest technology outfit by sales.
The sharp cost-cutting measures introduced in 2005 will continue, said HP chief executive Mark Hurd.
"We will get this cost out, while we continue to focus on growth," he said.