SAN RAMON, Calif. (AP) — Uber’s ride-hailing service edged closer to returning to its pre-pandemic levels during the final three months of last year, but its prospects remain clouded by the future direction of the novel coronavirus that has plagued its business.

The San Francisco-based company’s fourth-quarter results Wednesday came in above analysts’ projections. But Uber’s forecast for the current January-March period was slightly below what Wall Street had been hoping, suggesting that the omicron variant may have dented the ride-hailing service at the outset of the new year.

That minor letdown evidently didn’t dampen investors’ excitement about Uber’s progress at the end of last year. Its shares rose by about 6% in extended trading after the news came out. Even so, Uber’s stock price still remains more than 30% below its peak of roughly $64 reached about a year ago.

The latest numbers highlight how far Uber has come since the declaration of a worldwide pandemic in March 2020 triggered government lockdowns that kept most people at home, limiting the need for anyone to summon a ride on Uber.

Uber reacted by building up a then-nascent food-delivery division that now generates nearly half its revenue. And the company is now benefiting from a gradual recovery in its ride-hailing service. Passengers took a total of 1.77 billion trips on Uber during the last three months of 2021, a 23% increase from the prior year. But the volume remained below the pre-pandemic mark of 1.91 billion trips posted in the October-December period during 2019.

“Our results continued to demonstrate both how eager people are to move around their cities as restrictions ease up and how delivery has become an important part of their daily lives,” Uber CEO Dara Khosrowshahi told analysts during a Wednesday conference call. He also described the omicron variant as a “temporary deterrent” that won’t prevent Uber from accelerating its recovery as this year progresses.

In another positive sign, Uber has been profitable for two consecutive quarters under a financial yardstick called “adjusted earnings before interest, taxes, depreciation and amortization.”

By that measure, Uber earned $86 million during the final three months of last year — better than the average forecast of $66.6 million among analysts polled by FactSet Research. But Uber predicted it would earn $100 million to $130 million under that unconventional measure for the January-March period — below analysts’ forecast for $151 million.

Uber also was profitable during the past quarter under the accounting standards mandated by securities regulators, thanks to a $1.4 billion gain in some of its investments, including Aurora, which took over the ride-hailing service’s self-driving car division last year.

Lifted by windfall, Uber earned $892 million, or 44 cents per share, reversing from a loss of $968 million, or 54 cents per share, during the same time in the previous year. Revenue soared 83% from the prior year to $5.78 billion — about $300 million above analysts’ forecasts.

Uber’s delivery division, which has expanded from restaurant orders to include groceries, alcohol and even cannabis in some areas, accounted for $2.4 billion of the revenue while the ride-hailing service generated $2.3 billion. The company’s remaining revenue came from its freight division that delivers commercial goods and other supplies.