Facebook’s stock has soared by 17% after it earned $333m (£217m) in the second quarter of this year, reversing a disappointing loss in the same period a year ago.
The world's largest social network posted higher revenue for its mobile adverts, which it began showing for the first time last spring. They now account for 41% of its total revenue.
The California-based company’s stock jumped $4.48 (£2.93) to $30.99 (£20.24) in extended trading.
"I'm completely surprised," said analyst Brian Blau. “I was actually thinking that maybe they would have a soft quarter. That seems not to be the case."
Facebook earned $333m in the April-June period, up from a loss of $157m (£102.5m) in the same period a year ago.
Revenue grew 53% $1.8bn (£1.18bn) from $1.2b (£780m), the highest revenue growth since the fourth quarter of 2011, when it was still a private company.
"We've made good progress growing our community, deepening engagement and delivering strong financial results, especially on mobile," said chief executive Mark Zuckerberg.
"The work we've done to make mobile the best Facebook experience is showing good results and provides us with a solid foundation for the future."
Google is still the distant market leader when it comes to mobile ads.
It is estimated that the company held a 52% share of the global $8.8bn (£5.75bn) mobile ad market last year. This year, it is expected to grow to 56%.
More From Sky News