Twitter said on Thursday it could turn its first ever profit in the fourth quarter, after making sweeping cuts in expenses the past few months and finding sources of revenue beyond the advertising that dominates social media.
Shares of the company (twtr) jumped nearly 8% to $18.50 in premarket trading.
Twitter has never had a profitable quarter based on generally accepted accounting principles (GAAP), but it said on Thursday “we will likely be GAAP profitable” in the fourth quarter if it reaches the high end of its own estimates.
Twitter reported third-quarter revenue of $590 million, down 4% from $616 million a year earlier. The company attributed much of the decrease to a previously announced decision to wind down its TellApart advertising product.
Analysts on average had expected revenue of $587 million, according to Thomson Reuters.
San Francisco-based Twitter also disclosed in its quarterly earnings report that it had discovered an error in the way it had calculated the size of its user base since 2014 and revised its estimates downward, but that the difference amounted to less than 1%.
The company said it had 330 million monthly active users in the quarter ended on Sept. 30, up 4 million from a quarter earlier, helped by greater use of email and push notifications to point people toward tweets they want to read.
In the United States, where growth had stalled earlier this year, the number of users rose to 69 million from 68 million, the company said.
Analysts on average had expected 330.4 million monthly active users worldwide and 69 million in the United States, according to financial data and analytics firm FactSet.
Twitter said the error in past user estimates was caused when it wrongly counted people who logged into applications associated with the company’s Fabric software platform, which Twitter sold this year to Alphabet’s Google.
“Yes, they grew 4 million MAU sequentially, which is good enough for the stock to stay at current levels, but revenue growth remains a problem,” said Michael Pachter, managing director, equity research at Wedbush Securities.
“It’s great that they are controlling expenses and generating EBITDA growth, but investors want to see faster MAU growth and some revenue growth,” Pachter said.
Investors and analysts have at times criticized Twitter for how it describes the size of its user base, which is a key metric for social media companies. Unlike Facebook, Twitter does not disclose how many daily active users it has.
Chief Executive Jack Dorsey said in a statement that the business was making progress growing its audience and returning to revenue growth.
“We’re proud that the improvements we’re making to the product continue to bring people back to Twitter on a daily basis,” he said.
Twitter’s net loss narrowed to $21 million, or three cents per share, compared with $103 million, or 15 cents per share, a year earlier. Excluding items, the company earned 10 cents per share. Analysts on average had expected a profit of six cents per share, according to Thomson Reuters.
Helping to improve Twitter’s margin was a 16% cut in expenses from a year earlier. One factor was stock-based compensation, which declined 36% year-over-year, but Twitter said the cuts were broad-based, covering sales and marketing and research and development.
Twitter has struggled to convert its appeal among celebrities and public figures such as U.S. President Donald Trump to attract users and advertisers away from competitors including Facebook (fb) and Snap’s Snapchat (snap).
Up to Wednesday’s close, Twitter’s stock had risen 5.2% this year, compared with the 30.4% gain in the S&P 500 information technology index over the same period.
The company has stepped up efforts to keep people hooked through live-streaming deals, including broadcasts of concerts, professional golfing events, and news programs.
Last month, Twitter began a test of tweets that are as long as 280 characters, double the existing cap, to allow people to better express themselves.
The company also is diversifying its revenue further beyond advertising. Revenue from data licensing and other sources was $87 million in the third quarter, up 22% from a year earlier, Twitter said, adding that it signed “a significant number of new enterprise deals” in the quarter.
The most recent quarter was the third time revenue has declined since Twitter’s debut as a public company in 2013, as two of Silicon Valley’s giants, Facebook and Google (googl), have come to dominate the business of internet ads.
Twitter’s letter to shareholders made no mention of a regulatory challenge facing the company in the United States, where lawmakers are investigating how Russia used social media to interfere in the 2016 U.S. election. Twitter has pledged to make political advertising more transparent on its service. Russia has denied any interference.
The company has announced plans to toughen its rules on online sexual harassment, seeking to limit the number of bullies and abusers on the social network.