Shares of Celestica Inc., a Canadian company that assembles electronics for other companies, soared Friday after it reported second-quarter results that beat expectations.

Troubles at Research In Motion Ltd., which employs Celestica to assemble its BlackBerry phones, have weighed on the stock in recent months.

Shares of the Toronto-based company were up $1.12, or 13 percent, at $9.64

Celestica's earnings were $45.7 million, or 21 cents per share, up from $13 million, or 6 cents per share last year, when results were reduced by restructuring and tax charges.

Excluding stock-based compensation, amortization and restructuring charges, earnings were 27 cents per share in the latest quarter.

Analysts polled by FactSet were expecting earnings of 25 cents per share, on average.

Revenue was $1.83 billion, up 15 percent from $1.59 billion a year ago. Expectations were for $1.85 billion.

For the third quarter, the company expects revenue of $1.725 billion to $1.875 billion and earnings excluding items of 23 cents to 29 cents per share. Analysts expect $1.90 billion in sales and profit of 27 cents per share.