Facebook reported a second-quarter profit on Wednesday, exceeding analysts' expectations and providing the floundering stock with a much-needed surge in after-hours trading. The company's sales rose to $1.81bn, a 53% increase from the previous quarter. This figure was a slight increase from the $1.62bn analysts expected the company would make.

Second-quarter results show that the company it is steadily increasing how much of its advertising revenue comes from mobile. The amount of total advertising revenue jumped from 30% in the first-quarter to 41% in the second, comprising $656m in sales.

"We've made good progress growing our community, deepening engagement and delivering strong financial results, especially on mobile," Mark Zuckerberg, Facebook's founder, said in a statement. "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."

The company reported a $562m profit and $333m net income, which is 13 cents a share. This time last year, the company reported a loss of $157m in the second quarter.

The number of Facebook daily active users increased from 665 million in the first quarter to 669 million in the second. In June, the site had an average of 469 million daily users on mobile. Facebook had 819 million mobile monthly active users in second quarter of 2013, compared to 543 million in the second quarter of 2012. The new figures were also a boost from the 751 million reported last quarter.

With adjustments for one-time events including related payroll tax expenses and income tax adjustments, Facebook said it earned 19 cents a share.