Technology giant Yahoo has reported profits of $6.8bn (£4.2bn) for the three months to September, buoyed by earnings from the firm’s stake in Alibaba.

Yahoo was required to sell part of its stake ahead of the Chinese firm’s stock market floatation, netting it $6.3bn.

That made up for a continuing fall in advertising sales at Yahoo.

The search company has struggled to maintain market share against rivals like Google.

Revenue from ads decreased by 5%.

But overall revenues increase by 1% to $1.15bn from the same period a year earlier, and despite the lion’s share of its earnings coming from Alibaba, Yahoo’s numbers were better than expected, cheering investors.

Shares in the technology giant rose over 2% in after-hours trading, following the close of the US markets.

Mobile boost

In a statement accompanying the earnings release, Yahoo’s chief executive Marissa Mayer touted the firm’s investments in its mobile offerings.

“We have invested deeply in mobile and we are seeing those investments pay off,” she said.

“Not only are our mobile products attracting praise and engagement from users and industry awards, they are generating meaningful revenue for Yahoo.”

Yahoo said revenue from its mobile products was over $200m for the quarter, and estimated that mobile revenues could top $1.2bn by the end of the year.

Ms Mayer has been under pressure from investors and analysts to demonstrate that Yahoo can continue to grow now that it no longer has a significant stake in Alibaba, which had been providing a steady stream of revenue to the company.