Shares of Uber Technologies Inc. took a beating on Wall Street Thursday, falling 12 percent at one point in extended trading after the company announced generally disappointing results for its second quarter. It later recovered to $40.30.

The top ride-hailing firm in the United States reported a record net loss of $5.24 billion for the quarter compared to the loss of $878 million in Q2 2018. The huge net loss, however, was put down largely due to $3.9 billion of stock-based compensation expenses related to its IPO earlier this year. Another loss contributor was the nearly $300 million in "driver appreciation" related to the stock sale.

Minus stock-based compensation, Uber’s losses came to $1.3 billion, 30 percent worse than Q1. Loss per share came in at $4.72 versus the expected $3.12. Revenue also disappointed at $3.17 billion versus $3.36 billion expected by analysts.

Uber’s gloomy earnings report caught investors off guard, partly because rival Lyft Inc. on Wednesday reported revenue rocketing 72 percent to $867.3 million in Q2, handily beating all 30 analysts that estimated growth ranging from 60 percent to 66 percent.

Lyft’s good news saw Uber stock rising more than 8 percent while Lyft improved 3 percent during the day. Following Uber's report, however, its shares immediately plummeted 6 percent while Lyft lost nearly 2 percent Thursday.

Despite another quarter of loss-making, Uber is on track towards eventual profit, claims CEO Dara Khosrowshahi.

“No doubt in my mind that the business will eventually be a break even and profitable business,” said Khosrowshahi to CNBC.

“We think that 2019 will be our peak investment year and we think that 2020, 2021, you’ll see losses come down. I think our break even is something that we can push the company to break even if we really wanted to frankly.”

Uber’s core ride-hailing business generated $12.19 billion in gross bookings during Q2, beating analysts’ estimate of $12.11 billion. Gross bookings is a measure of total value of car rides, scooter and bicycle trips, food deliveries and other services before payments to drivers, restaurants and other expenses.

The startup screen of Uber is pictured on 31 Aug. 31, 2017, in Hong Kong. Photo by studioEAST/Getty Images

Uber Eats generated $3.39 billion in gross bookings, somewhat short of analysts’ expectations of $3.51 billion.

“The Eats business is still a business that carries very significant growth going forward and that continues to attract a lot of capital,” said Khosrowshahi.

“Not just in the US, but all over the world. With the eats business there’s a lot of capital chasing a lot of growth and we’re the leader on a global basis. So, I don’t expect that business to be profitable in the next year or year after frankly.”