Uber reported Thursday that it lost $5.2 billion in the second quarter, pointing to the tough reality of navigating the high-cost gig economy as a public company.

The quarterly results, Uber's largest loss, were hampered by a $3.9 billion one-time stock-based compensation item stemming from the company's May IPO, as well as a driver appreciation rewards totaling nearly $300 million.

Adding to that toll, Uber said it also faced rising competition in global markets and slowing growth on its core ride-hailing platform, where revenue increased by 2 percent. Overall revenue rose 14 percent, to $3.2 billion.

Uber CEO Dara Khosrowshahi spelled out a strategy to combat those trends on the company's earnings call, largely reliant on bettering the company's algorithms. Uber is working to improve the function of matching riders to drivers and each other, as well as increasing the number of seats filled in each ride, which would improve profitability. And Uber is working to create better partnerships with local transit agencies in its effort to entice more passengers to take shared trips rather than drive alone.

"We're focused on improving profitability in this market and many other markets around the world and based on what we read Lyft seems to be focused in a similar way," Khosrowshahi said on the call.

Revenue is rising in part due to a cooling price war with rival Lyft, as both companies prioritize profitability over growth and spend less on incentives to attract riders to their apps. But while Uber is offering fewer discounts, its staggering loss showed it is having trouble finding a path to profitability for its array of businesses - including ride-hailing, food delivery, scooters and freight.

Uber has set its sights on becoming a global one-stop shop for transportation and logistics, competing not just with ride-hailing rivals but with tech giants such as Amazon. The company wants to leverage its algorithms and routing knowledge to remove what it sees as inefficiencies in passenger transportation, something that can also apply to areas including food delivery and freight.

Despite its plans to build a logistics empire, its steep losses and rocky entry to being a publicly traded company point to larger concerns about Silicon Valley "unicorn" start-ups, which have amassed millions of customers and raked in investor cash but have yet to prove they can turn a profit.

Uber stock prices fell 11 percent, to $38.07, in after-hours trading, well below the company's initial stock price of $45. The stock had recovered slightly after the earnings call, to just over $40.

Uber has consistently said 2019 was expected to be an investment year. But the company also said it laid off 400 members of its global marketing team this summer - about a third of its communications staff. Uber also faced stiff competition in Latin America, where its reported revenue fell by nearly a quarter compared with the same period a year ago.

Lyft, on the other hand, reported Wednesday better-than-anticipated revenue growth and other positive metrics, despite a $644 million loss for the quarter. That sent Lyft and Uber stocks up in regular trading Thursday, before Uber's earnings release.

Still, Uber's chief competitor, Khosrowshahi said, was not Lyft but rather car ownership. When stacked up against that metric, Uber is "faring very well," he added.

The company's popular Uber Eats food delivery service fueled significant revenue growth, up 72 percent from the same quarter last year as it brought in $595 million in revenue.

"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," said Uber Chief Financial Officer Nelson Chai, in a statement accompanying the earnings.