Electronics manufacturing company Sanmina-SCI ( SANM - Get Report) narrowed its second-quarter loss by a healthy margin on Tuesday, adding that it would beat current third-quarter earnings estimates.

The stock surged 13.6% in after-hours trading, rising 55 cents to $4.59.

Sanmina lost $103.4 million, or 20 cents a share, for the quarter, compared with a loss of $1.04 billion, or $1.99 a share, during the parallel quarter. The current second-quarter results include a $112.2 million one-time charge associated with the early retirement of the company's high-yield notes, due 2010.

A year ago, the company's results were hurt by several items, including a goodwill impairment charge of $600 million.

Excluding items, net income for the quarter was $30.5 million, or 6 cents a share, compared to $29.3 million, or 6 cents a share, over the same period last year. On this basis, the company met analysts' expectations.

On the top line, Sanmina reported $2.67 billion, down from a year ago when the company's sales totaled $2.89 billion. Revenue was a shade higher than Thomson First Call estimates of $2.66 billion.

"Our results this quarter reflect an improving economy as well as increasing demand in our core EMS, printed circuit board fabrication and backplane businesses," Jure Sola, CEO of Sanmina said in a statement. "The second quarter is seasonally our slowest, so I am especially satisfied with our gross margin improvement."

Gross margins rose to 6.2% from 5.2% a year earlier.

Sola credited the rise in margins to increased operating efficiencies and a shift in product mix to higher margin core business, offsetting the PC sector. He noted that the positive market trends should continue through the year.

For the third quarter, Sanmina said that excluding items, the company would post net income between 8 cents and 10 cents a share on revenue between $2.7 billion and $2.8 billion. That EPS is higher than average consensus estimates of 7 cents. Revenue projections are in the range of what analysts are looking for at $2.77 billion.