Twitter shares are surging in the pre-market, up 13%, after the company reported stronger than expected Q3 earnings and revenue thanks to higher spending from advertisers, even as the company's Monthly Active Users dropped to 326 million in the third quarter, below the 330 million expected, and a decrease of 9 million from the second quarter.

The social media company reported Q3 adj. EPS of 21c, above the 14c estimate on revenue of $758.1 million, also above the $701.3 million expected.

Adjusted Ebitda of $295.4 million, beating consensus estimates of $237.4 million.

Twitter's 29% jump in revenue marks the third consecutive quarter of double-digit growth according to Bloomberg, and Twitter has reported positive net income for four straight quarters.

At the same time, while sales and earnings have grown stronger, Twitter has suffered from a drop in user metrics, especially after purging its ranks to eliminate fake accounts, an effort that continues ahead of the U.S. midterm elections in November.

"We have a more engaged audience and we are delivering a better return on investment for advertisers," Chief Financial Officer Ned Segal said in an interview with Bloomberg. "We are now seeing the fruits of our labor and going into the fourth quarter we have the wind in our backs."

Like Facebook, Twitter had come under pressure to clean up its platform even as it relies on user growth to drive its advertising business. The company said it had kicked off millions of accounts in recent months, and while the company acknowledged that it has had to divert resources to cope with the challenge, executives say the cost is necessary to support the health of its platform over the long term.

As a result of this cleanup, the number of MAUs fell to 326 million (International MAUs 259 million; U.S. MAUs 67 million), down 9 million from the second quarter and below the 330 million analysts expected. The user number was also down 4 million from the same quarter a year ago. Twitter warned in its July earnings report of a continued drop in the metric as a result of efforts to clean up its service and stricter privacy rules in Europe. The company said those trends will continue and lead to another decline in monthly users for the fourth quarter.

Twitter said the decline was due to a number of factors, including “decisions we have made to prioritise the health of the platform”, the impact of new European privacy rules and a technical issue that resulted in fewer notifications sent out.

And while it did not disclose specific numbers, Twitter said Daily active users rose 9% in the quarter, a slowdown from 11% in the second quarter and 14 per cent a year ago.

As Bloomberg notes, although Twitter is becoming a more attractive place for advertisers, the company has struggled to expand its user base. Twitter has improved its sales process and targeting for advertisers with investments in artificial intelligence and machine learning, Victor Anthony, an analyst at Aegis Capital Corp., said before the earnings were released. It has also used new technologies to better predict what users want to see and curate the news in their feeds.

"The problem is getting users to see the value of Twitter," Anthony wrote in a note. "As Twitter continues to improve the platform, we expect to see more stickiness from the new users."

Looking ahead, Twitter forecast 4Q adjusted Ebitda of $320 million to $340 million, in line with the estimate of $332.3 million; Capex is expected to grow $60 million to $85 million next quarter.

The company plans to grow its employee ranks by as much as 15 percent by the end of the year, Segal said, adding that "our retention and ability to attract people to Twitter has gotten a lot better."

The market looked past the disappointing MAU number which it attributes to the ongoing Twitter purge, and focusing on the improvement in top line and profit, is rewarding the stock by pushing it 13% higher.