Twitter, which has struggled to keep pace with rivals, says it could show its first net profit in the coming quarter if it continues to narrow losses and show signs of profitability

Twitter said Thursday it hopes to post its first-ever profit by the end of the year, delivering a stronger-than-expected update which sent its shares flying higher.

Shares in Twitter leapt 14 percent in early trade to $19.68 on the back of investor optimism at its third quarter results—even though the firm posted ongoing losses and a dip in revenue.

While the social network, which has struggled to keep pace with rivals, posted a loss of $21 million in the third quarter, it was a marked improvement from the $103 million deficit it racked up a year ago.

Likewise, while revenues fell four percent over a year to $590 million, the results were not as bad as analysts had feared for the one-to-many messaging platform.

"Our work to increase relevance and make Twitter easier is making an impact," claimed chief executive Jack Dorsey as the results were announced.

While Twitter has built a solid core base of celebrities, politicians and journalists, it has failed to achieve the broader appeal of Facebook and other social platforms, hurting its ability to bring in ad revenues.

But the network has stepped up efforts to boost its user base and engagement, notably with some 30 video partnerships, as part of its turnaround efforts.

In a statement, Twitter said it would "likely" show its first net profit in the fourth quarter if growth reaches the high end of its target.

'Enabling more voices'

Twitter's monthly active user base rose slightly to 330 million, roughly in line with forecasts. And Twitter said daily active users rose 14 percent from last year. The number of US monthly active users grew four percent to 69 million, and international users increased by the same ratio to 261 million.

Dorsey said Twitter was seeking to use artificial intelligence and machine learning to make the most relevant content stand out more prominently, following the example of Facebook.

"Our biggest efforts are really applying machine learning and deep learning to every single tweet," he said, in order to "make sure that we're delivering what is something that matters to people."

Twitter CEO Jack Dorsey says the social network will use more artificial intelligence to deliver relevant content in user feeds as part of an effort to boost user growth and engagement

Dorsey said Twitter is still studying the impact of a test to double its 140-character limit for tweets and would make a decision in the coming weeks on the next step.

"I want to make sure that we are maintaining our sense of brevity, make sure that we are maintaining our sense of real time and showing what's happening in the world," he said.

"We want to make sure that we're also enabling more voices to speak and not be frustrated by the constraints."

Russia controversy

The strong rally came despite Twitter's acknowledgment that it had overstated its user base by as many as two million in the prior quarter by counting users of a third-party application.

Twitter skeptic Ross Gerber at the investment firm Gerber Kawasaki was unimpressed, saying the company's improved finances came mainly from cutting costs like stock compensation to employees.

"Another terrible report from #twitter. User growth almost nil," Gerber tweeted.

"Many social platforms adding millions a day. #twitter is done growing. Video not made much difference. Ad platform little progress."

Twitter, which has acknowledged some lift from President Donald Trump's use of the platform, has also been struggling with ways to filter out abuse and promotion of violence, and has been caught up in the controversy over manipulation during last year's election campaign by automated accounts or "bots" directed from Russia.

The first social network to announce a policy of "transparency" for ads designed to influence elections, Twitter announced separately Thursday it was banning ads from Russia-based media groups RT and Sputnik following findings they spread misinformation during the campaign.

Dorsey noted that Twitter has stepped up its efforts to weed out inappropriate content.

"We're more focused than ever on making Twitter a safe place for everyone," he said.