Uber on Thursday reported second-quarter earnings that widely missed Wall Street expectations.

The ride-hailing giant lost $4.72 per share on revenues of $3.17 billion.

A big chunk of Uber's massive $5.24 billion loss was because of stock-based compensation from its initial public offering earlier this year.

The stock was down as much as 12%, or $5.33, in after-hours trading.

Follow Uber's stock in real time here.

Uber on Thursday reported second-quarter losses that were wider than Wall Street's expectations. The stock was down as much as 12%, or $5.33, in after-hours trading.

Here are the important numbers:

Revenue : $3.17 billion

: $3.17 billion Earnings per share (GAAP) : -$4.72 versus -$3.23 expected

: -$4.72 versus -$3.23 expected Net loss : $5.24 billion, in line with estimates

: $5.24 billion, in line with estimates Gross bookings: $15.76 billion (up 37% year over year)

Markets Insider A major chunk of those losses, $3.9 billion, is from stock-based compensation to employees related to the company's initial public offering in May. It's a typical expense for companies who go public, and Uber previously warned in regulatory filings that this large expense would be occurring, so it likely isn't a surprise for investors.

Even with the noncash expenses, Uber still burned through $920 million in cash during the three-month period. In the same period of 2018, the company spent $153 million.

"'We're very confident that this company, at maturity, can be cash-flow positive," CEO Dara Khosrowshahi said on a conference call with analysts.

In order to stem its cash burn, Uber laid off 400 marketing employees last month. Those savings, which mostly affected brand marketing and weren't limited to any one geographic area, won't be seen until next quarter.

Read more: Uber marketing employees describe this week's 'bloodbath' when the company laid off 400 employees in more than a dozen countries in one day

"While we will continue to invest aggressively in growth, we also want it to be healthy growth, and this quarter we made good progress in that direction," Nelson Chai, Uber's chief financial officer, said in a press release.

Uber's stock has struggled to remain above its first trading price since its May IPO, but it got a major boost on Thursday following Lyft's earnings report on Wednesday afternoon.

Lyft's report, 24 hours ahead of Uber, handily topped Wall Street expectations. The smaller company, which operates only in North America, as opposed to Uber's global reach, raised its guidance for investors. Wall Street now thinks Lyft could reach profitability sooner than previously expected.

Gross bookings, a closely watched measure for ride-hailing investors that includes most fares and Uber Eats receipts before paying drivers or couriers, reached $15.76 billion. That's a 37% increase from the previous year, Uber said.

Troy Wolverton contributed to this report.

More Uber news: