Hewlett-Packard (HPQ) provided fresh evidence of its turnaround on Tuesday by posting a narrow fiscal fourth-quarter earnings beat and sales that fell much less than Wall Street had feared.

The stronger-than-anticipated results along with mostly in-line guidance helped juice H-P’s shares more than 7% in after-market trading.

H-P said it earned $1.4 billion, or 73 cents a share, last quarter, compared with a loss of $6.9 billion, or $3.49 a share, a year earlier.

Excluding one-time items, it earned $1.01 a share, down 13% from the year before. Analysts had been calling for EPS of $1.00.

Revenue fell 3% to $29.1 billion, easily trumping the Street’s view of $27.91 billion. Cash flow from operations slumped 31% to $2.8 billion.

“Our Q4 results demonstrate that HP's turnaround remains on track heading into fiscal 2014. While we still have much more work to do, our business units and their core assets are delivering on HP's strategy to help customers thrive by providing solutions for the New Style of IT,” H-P CEO Meg Whitman said in a statement.

H-P said its personal systems revenue dipped 2% last quarter as commercial sales tumbled 10%, offsetting a 4% gain for commercial revenue. Desktop units dropped 5%, while notebook units increased 3%.

Printing revenue dipped 1% even as total hardware units increased 6%.

H-P’s enterprise group reported a 2% increase in revenue as growth in networking and industry standard servers offset a 17% drop in business critical systems sales.

Looking ahead, H-P projected fiscal first-quarter non-GAAP EPS of 82 cents to 86 cents, compared with the Street’s view of 85 cents.

For the full year, H-P sees non-GAAP EPS of $3.55 to $3.75, which is basically in line with forecasts from analysts for $3.65.

H-P said it returned $763 million to shareholders in the form of dividends and share buybacks during the quarter.

Shares of Palo Alto, Calif.-based H-P soared 7.89% to $27.07 in extended trading Tuesday afternoon. H-P has already soared 76% year-to-date and 99% over the past 12 months. 

Follow Matt Egan on Twitter @MattMEgan5