Twitter jumped sharply on Tuesday after the social media company easily topped earnings and revenue expectations.

The firm posted earnings of 2 cents a share, ex-items, compared to a loss of 12 cents a share, ex-items, in the year-ago period. The company also reported a revenue of $312 million, an increase of 124 percent year-over-year. Shares popped following the earnings report. 

Monthly average users grew 24 percent year-over-year to 271 million, as of June 30, 2014, the firm said in a release.

Ad revenue increased 129 percent year-over-year, to a total of $277 million, of which 81 percent came from mobile advertising.

Other social media companies such as Facebook and LinkedIn edged higher following the report. Chinese microblog Weibo jumped 4 percent.

The company added that it expects to post sales of between $ 1.31 billion and $1.33 billion in its fiscal full year, beating Wall Street expectations.

"The differential you're seeing in the raised guidance is due to the success that we've had over the course of the beginning of the year and our view of how that success will translate into the back half of the year," said Dick Costolo, CEO of Twitter, on CNBC's Closing Bell.

Analysts had expected Twitter to report a loss of 1 cent per share on $283 million in revenue, according to a consensus estimate from Thomson Reuters.

Read More: I don't see bubble in social media stocks: Cuban

Since going public in November, Twitter shares have been volatile, peaking around $74 at the end of last year. Twitter faced some pressure on this quarter's earnings announcement after social media rival Facebook posted huge numbers last week, seeing its stock jump 20 percent as a result.

User growth remains one of the key issues for Twitter—its monthly average growth slowed to 25 percent last quarter, and some analysts expect that trend to continue. 

Read More: Twitter CEO, the Internet has questions for you

"We have a very clear set of goals that we are looking to achieve and they are all base on the core characteristics that make Twitter the world's real time information network—that we're public, that we're real-time that we're conversational, that we're widely distributed," Costolo said. "Our goal is to have the largest total audience in the world and reach every person on the planet. That's our goal. Nothing less than that."


More from CNBC