In a surprise after several quarters of disappointing results, Twitter on Wednesday reported better-than-expected earnings and revenue.

Shares of the social media company surged more than 10% following the report.

Here's how the company did compared with what Wall Street was expecting, according to Thomson Reuters consensus estimates:

EPS: 11 cents a share vs. 1 cent a share expected

Revenue: $548 million vs. $511.9 million expected

Monthly active users: 328 million vs. 321 million expected

The company accelerated its monthly active users to 328 million, 7 million more than expected and 9 million more than the prior quarter. Twitter said daily usage accelerated for the fourth-consecutive quarter — to 14 percent year-over-year growth. It didn't disclose a daily active user number.

Twitter shares rose more than 11 percent in premarket trading after the report was released.

CEO Jack Dorsey attributed the accelerating user growth and engagement to a number of changes that have improved the user experience in the timeline and notifications to draw users back to the timeline. Dorsey pointed to the deployment of machine learning to show users tweets that are more relevant to them.

Dorsey also said the company has been rolling out product improvements faster, such as making it easier to reply to tweets and to follow conversations, and the ability to search and browse by topics and live content. Dorsey said the company is also making progress cracking down on abuse on the platform, and that's having a positive impact.

The company reported earnings of 11 cents per share, 10 cents a share better than expected and down from 15 cents in the year-ago quarter.

Revenue was better than expected at $548 million, compared with estimates of about $512 million, but it continues to decline. The company's outlook for the second quarter was far worse than expected, projecting adjusted EBITDA of $95 million to $115 million, while analysts projected a consensus of $141 million, according to Street Account.