What happened

Shares of Uber Technologies (UBER -0.57%) rallied on Tuesday following a favorable court ruling for the ride-sharing specialist. The stock finished the trading session with a 5% gain. 

So what 

A California appeals court ruled that Uber and other ride-hailing companies can classify their drivers as independent contractors. The decision overturns a lower court ruling that had determined doing so was unconstitutional.

The decision will allow Uber to avoid substantial costs that it otherwise might have been forced to incur. For example, Uber and its rivals will not need to provide certain benefits or pay overtime to its drivers because they will not be considered employees.

But had the appeals court's ruling not been in Uber's favor, it could have made it difficult for the company to operate effectively in California. And had other states adopted similar rules, it might have jeopardized Uber's entire business model.

Additionally, Uber Chief Legal Officer Tony West said the ruling was "a victory for app-based workers," as it preserved "the unique flexibility of app-based work." 

Now what

The decision helps to alleviate some regulatory risk that has weighed on Uber's stock price. However, the ruling is expected to be challenged in the California Supreme Court, so some risk remains.

Still, analysts and investors cheered the news. Jefferies analyst John Colantuoni, for one, estimates that Uber, Lyft, and DoorDash may have avoided as much as $170 million in additional costs due to the decision. 

"The ruling clears the path for Uber's continued stock outperformance," Colantuoni said.