Excluding restructuring and related impairment charges but including stock-based compensation and amortization charges, Sun posted a loss of 1 cent per share versus a consensus loss of 9 cents, according to Reuters Estimates.

The company -- which is shedding up to 6,000 jobs or 18 percent of its workforce -- said it lost $209 million, or 28 cents a share for the quarter ending December 28, compared with a $260 million profit, or 31 cents a share, a year ago.

The company had revenue of $3.22 billion, compared with $3.62 billion one year ago.

Sun Microsystems shares rose 7.8 percent to $4.30 in after-hours trading after closing at $3.99 on the Nasdaq.

(Reporting by David Lawsky, editing by Matthew Lewis)