Shares of Sun Microsystems Inc. rose more than 4 percent on Tuesday after the computer server maker said it hard turned around from a loss a year ago to post a higher than expected profit.

Sun said late Monday that it earned $329 million, or 9 cents per share in the fourth fiscal quarter, up from loss of 9 cents per share, $301 million in the year ago period.

Sun shares rose 21 cents, or 4.3 percent to $5.10 at the end of regular trading hours on the Nasdaq Stock Market.

The latest result comes as Sun continues to recover from several years of losses following the downturn of the dot-com implosion over six years ago.

Revenues were $3.84 billion, a slight increase from the $3.83 billion in sales the Santa Clara-based company had last year.

Analysts, on average, had expected 5 cents earnings per share on $3.83 billion in sales.

The fourth-quarter profit margin marks significant progress toward our longer-term growth plan of at least 10 percent operating margin for the 2009 fiscal year, Chief Executive Jonathan Schwartz said in a statement.

Sun has tried to stage a recovery by revamping its product line, selling servers powered by chips from and Intel Corp. and Advanced Micro Devices Inc. The company also announced about 5,000 job cuts to reduce costs.

Executives told analysts on a conference call that the company expects full-year revenue growth in fiscal 2008 in the low- to mid-single-digit percentage range.