Sanmina-SCI ( SANM) reversed its year-ago losses and topped Wall Street's earnings expectations.

Sanmina shares added 7 cents, or 2% to $3.50 in extended trading.

The San, Jose, Calif.-based electronics manufacturing services firm posted net income of $28.2 million, or 5 cents a share, for its first quarter, compared with a loss of $28.1 million, or 5 cents a share, in the same period last year.

Excluding certain items, Sanmina earned $34.7 million, or 7 cents a share, vs. $39.6 million, or 8 cents a share, in the year-ago quarter. A survey of analysts by Thomson First Call pegged the company for 6 cents a share.

Sales totaled $2.78 billion for the quarter, essentially in line with the $2.8 billion forecast by analysts.

"I am pleased with our first-quarter results," Jure Sola, Sanmina CEO, said in a statement. "Demand in the first quarter was not as strong as we have seen historically, but we experienced nice growth from a number of our core markets and a majority of our key customers."

Looking ahead, Sanmina anticipates revenue to be "seasonally down" and in the range of $2.65 billion to $2.75 billion, bracketing the $2.72 billion consensus forecast.

Non-GAAP EPS will range from 5 cents to 7 cents, excluding stock-based compensation, restructuring and other charges.

The consensus forecast for the March quarter is 6 cents a share.