NEW YORK -- Lyft continued to bleed money in its second quarter but says it expects to stem some of those losses, raising its outlook for 2019.

The ride-hailing company on Wednesday posted revenue of $867.3 million, up 72% from the same time last year.

But the San Francisco-based company lost $644.2 million in the quarter, which was worse than the $445 million loss that analysts polled by FactSet expected.

More than a third of the loss, or $296.6 million, came from stock-based compensation Lyft paid out after its initial public offering in March. The company also lost $141.1 million due to changing requirements for liabilities for insurance.

Even so, the company improved its outlook for 2019. Lyft now predicts it will lose between $850 million and $875 million after expenses such as interest, taxes, depreciation and amortization in 2019, an improvement from the previous predicted loss of $1.15 billion to $1.175 billion.

With the revised guidance, the company estimates that 2018 may have been the peak loss year, and expects to lose less money in 2020, said Brian Roberts, chief financial officer, in a conference call with investors.

"As a result of our strong top line growth and an improving market environment we generated significant operating leverage," said Logan Green, CEO, on the conference call. "This was a milestone quarter on our path to profitability."

The rollout of Shared Saver, which offers riders a more affordable ride if they walk a short distance to the car, led to improvements in system-wide efficiency and monetization, Green said. The company also has been offering public transit information in its app in eight markets, which can be combined with Lyft's shared bikes or scooters, he added.

Lyft has been investing to grow its share of its more valuable offerings such as premium, business and airport rides, Roberts said.

"We are focused on driving profitable growth, not growth at all costs," Roberts said.

The company's growth in active riders — and revenue per active rider — was better than expected, which drove its revenue growth, Green said. Lyft's revenue per active rider was $39.77, up 22% compared to the same time last year.

The quarter turned out "much better than feared," said Daniel Ives, managing director of equity research at Wedbush Securities Inc. "The company is showing where they're cutting expenses relative to expectations, and that's important to putting them on the eventual path to profitability," he said.

Uber, which is Lyft's main and much larger rival, is set to report earnings Thursday.

Lyft's stock price has fallen sharply since its debut. Its shares rose 3% to about $63 in after-hours trading Wednesday, which is down 13% from its IPO price of $72.

It was the first of the major ride-hailing companies to go public, beating Uber to its stock market debut. Early enthusiasm among investors quickly fizzled, along with the stock price. The company has not turned a profit or demonstrated a path to profitability. However, its losses were steeper last quarter, when the company was hit with more expenses from stock compensation related to its IPO.

Its adjusted net loss, after accounting for the stock compensation, insurance change and other expenses, widened to $197.3 million, from the $176.5 million adjusted net loss it posted during the same quarter last year.