SAN RAMON, Calif. — Uber’s ride-hailing service is regaining the momentum that it lost during the pandemic, but it’s coming at a cost that’s raising more doubts about the company’s ability to make money.

At the same time, Uber’s unprofitable delivery service is still growing at a torrid pace, indicating that some homebound habits may be here to stay, even though people are going out again.

Those two trends produced Uber’s best quarterly report since the pandemic clobbered the San Francisco company 17 months ago.

The results announced Wednesday for the April-June period included a rare profit that investors glossed over to focus on ongoing losses in Uber’s operations.

The second-quarter profit stemmed from a one-time gain of $1.4 billion to recognize recent increases in the values of Uber’s stakes in China’s leading ride-hailing service, Didi, and a self-driving car division that it recently handed off to Silicon Valley startup, Aurora.

Those accounting adjustments eclipsed Uber’s losses in its business, enabling the company to post a second-quarter profit of $1.14 billion, or 58 cents a share, reversing a loss of $1.78 billion suffered in the same three-month period of 2020, during the early throes of the pandemic.

Revenue for the quarter totaled $3.93 billion, more than doubling from the dismal conditions at the same time last year when most people were still stuck at home and not looking for rides to go anywhere. The revenue figure exceeded the estimate of $3.76 billion among analysts surveyed by FactSet Research.

But Uber investors tend to focus more on an unorthodox measure called “adjusted earnings before interest, taxes, depreciation and amortization.”

The company had previously pledged to become profitable under that yardstick by the final three months of the year — a promise CEO Dara Khosrowshahi reiterated Wednesday — only to take a step back during the second quarter with a loss of $509 million. While that was lower than a year ago, the latest quarterly loss came after an adjusted loss of $359 million during the first three months of the year.

The larger loss was largely due to the bonuses and other incentives Uber is offering to drivers to rejoin its ride-hailing service after many quit because of safety concerns during the worst of the pandemic. In the U.S., it’s also competing against Lyft, which is also trying to lure back drivers.

Uber is expecting the need for driver incentives to taper off, enabling it to reduce its adjusted loss for the current quarter ending in September to $100 million or less before turning into an small adjusted profit during the final three months of the year.

Investors, though, clearly remain skeptical. Uber’s stock dropped more than 4% in extended trading after the mostly upbeat second-quarter report came out. The shares had already fallen by more than 30% from their peak of about $64 in February.

Uber, though, had mostly a positive story to tell during the past quarter. The highlights included a total of 1.51 billion rides provided — more than doubling from the same time last year. The company’s ride-hailing revenue also more than doubled from last year to $1.62 billion.

Despite those strides, ride-hailing revenue was still about 30% below its levels at the same time two years ago, long before the pandemic upended the economy. Total rides were down about 10% from two years ago.

As it has been doing in recent quarters, the service that Uber built up to deliver take-out food and groceries is bringing in even more money. Delivery revenue totaled nearly $2 billion, more than doubling from a year ago. But the delivery service also is piling up losses as it expands.