Twitter Inc. on Thursday said it overstated its number of users for the past three years and committed to take advertising off its site from two Russian media outlets, while reporting modest user growth for the third quarter.

Even so, the social-media company’s shares gained nearly 19% as Twitter also reported a narrower loss for the quarter and raised its earnings forecast for the current period. At Thursday’s closing price of $20.32, the stock is still below its 2013 initial offer price of $26.

Twitter said it will no longer accept advertising from any account owned by Russian-backed news outlets RT and Sputnik. U.S. intelligence officials have described RT as “the Kremlin’s principal international propaganda outlet.”

Twitter’s decision marks a stark change in company practice. The RT’s editor in chief said in a tweet on Thursday that Twitter approached RT ahead of the 2016 U.S. presidential election to pitch ways RT could advertise on the service during that stretch.

Commenting on the interactions between RT and Twitter, a person familiar with the matter said it is the job of any advertising sales team to aggressively recruit and retain clients.

“We did not come to this decision lightly,” Twitter said in a statement.


In the latest quarter, Twitter realized that it had been mistakenly including users of a service for third-party apps in the company’s tally of monthly users, a spokeswoman said.

Twitter restated its user counts for the past three quarters—revising them down by one million to two million—but said it didn’t have user data going back further than that.

Twitter in the third quarter added four million monthly users—analysts were expecting just over one million—bringing its total to 330 million monthly users. For the second quarter, however, the adjusted numbers showed the company’s tally actually shrank for likely the first time since 2015, by one million users. Previously Twitter had said user growth was flat in the second quarter.

Revenue in the third quarter declined 4.2% from a year earlier to $590 million. Analysts were expecting $587 million, according to FactSet.

Twitter has posted a string of quarterly losses as a public company, but its latest, $21.1 million, was the smallest and compared with $103 million in last year’s third quarter.


“Our work to increase relevance and make Twitter easier is making an impact,” Twitter Chief Executive Jack Dorsey said on the company’s earnings call.

Mr. Dorsey attributed the user growth in the latest quarter to improvements made to the company’s short-messaging service in the period, noting that Twitter is focusing increasingly on personalizing the content that appears in users’ feeds.

For years, content in the timeline was listed chronologically without algorithmic tweaks, but now the company is expanding its team of artificial intelligence specialists responsible for identifying new content that users might want to see.

“We’re hiring, and we continue to look for leadership in all these areas,” Mr. Dorsey said.


Twitter’s error in counting users threatens the company’s credibility during a critical period. The growth of Snap Inc.’s Snapchat has increased competition for advertising dollars between the social-media rivals. Meanwhile, Twitter is facing scrutiny on multiple fronts for how it handles problem accounts on its network, including people posting abusive content and alleged Russian manipulation.

“It really is make-or-break time for Twitter,” said Jim Cridlin, global head of innovation at Mindshare, a unit of ad-agency giant WPP PLC.

Twitter said the error in counting monthly users didn’t impact its measure of daily users, which grew 14% in the quarter. Twitter doesn’t disclose its raw number of daily users, but said fewer than half of its 330 million monthly users log on daily.

The service that erroneously counted the monthly users, Digits, allowed people to log into other apps using their credentials from Twitter. Alphabet Inc.’s Google bought Digits from Twitter earlier this year as a part of a larger acquisition of developer tools.


The Twitter spokeswoman said the company believes the impact of the error was smaller before this year because Digits had fewer users. Twitter said it doesn’t have the data to reconcile its user figures going back further than the end of 2016 because of its retention policies for certain kinds of information.

For the fourth quarter, Twitter projected adjusted earnings before interest, tax, depreciation and amortization of between $220 million and $240 million—a more ambitious target than the $197 million analysts expect, according to FactSet. If Twitter hits the high end of that range, it could record its first quarterly profit since going public in late 2013, the spokeswoman said. A year ago, Twitter publicly articulated the goal of “driving toward” profitability in 2017.

“We feel really good about the progress we’ve made,” said Twitter’s chief of operations, Anthony Noto. “We’re ahead of where I would have guessed back in January today.”

—Jack Nicas contributed to this article.

Write to Georgia Wells at Georgia.Wells@wsj.com