Advanced Micro Devices (AMD) - Get Report was able to swing to a profit in the second quarter this year, after losing a penny a share during the same quarter last year, lifting shares in after-hours trading Wednesday, July 25.

Shares of the chipmaker are up nearly 14% in afternoon trading.

AMD reported non-GAAP earnings of 14 cents per share on revenue that increased 53% year over year to $1.76 billion. Analysts were expecting the company to report earnings of 13 cents per share on revenue of $1.72 billion.

Operating expenses of $467 million left the company with an operating income of $186 million and net income of $156 million.

For the third quarter, AMD said it expects revenue to be approximately $1.7 billion, plus or minus $50 million, an increase of approximately 7% year-over-year, and non-GAAP gross margin to increase to approximately 38%. Analysts were expecting revenues of $1.764 billion in the third quarter, according to FactSet.

The company said its third-quarter sales growth would be driven by its Ryzen and EPYC products, but partially offset by lower sales of GPU products in the blockchain market.

"We had an outstanding second quarter with strong revenue growth, margin expansion and our highest quarterly net income in seven years," said Dr. Lisa Su, AMD president and CEO. "Most importantly, we believe our long-term technology bets position us very well for the future. We are confident that with the continued execution of our product roadmaps, we are on an excellent trajectory to drive market share gains and profitable growth."