SAN FRANCISCO >> Dodging a legal threat to its future, Uber has agreed to pay up to $100 million to a group of its drivers to avoid having to treat them as regular employees.

Under terms of the deal announced Thursday evening, Uber would not have to reclassify its independent contractor drivers or offer them employee benefits such as minimum wage, overtime and reimbursement for driving expenses.

The case, scheduled for trial in June, has captivated the Bay Area because a ruling against Uber — the world’s most valuable startup — had the potential to upend the exploding on-demand industry. Many other companies in the space follow Uber’s independent contractor business model, which saves them money and — they insist — offers their workers flexibility.

Boston-based attorney Shannon Liss-Riordan, who represents the 385,000 drivers in the dispute, said the settlement allows drivers to avoid the risk that a jury in San Francisco — a city where Uber use is widespread — would side with the ride-booking company. The settlement covers drivers in both California and Massachusetts, where Liss-Riordan’s practice is based.

“We realize that some will be disappointed not to see this case go to trial in June,” Liss-Riordan wrote in an email. “We were looking forward to this trial. But we believe the settlement we have been able to negotiate for Uber drivers throughout California and Massachusetts provides significant benefits — both monetary and non-monetary — that will improve the work lives of the drivers and justifies this compromise result.”

If a federal judge approves the settlement, Uber will pay $84 million right away. The remaining $16 million is contingent on Uber’s growth. If Uber’s valuation grows by one and a half times in the first year after it goes public, the company will have to fork over the extra cash. Uber, valued at more than $60 billion, has not announced any plans for an IPO.

The money will be allotted to drivers based on how many miles they have driven for Uber, with drivers with more than 25,000 miles possibly receiving an average of $8,000, according to Liss-Riordan.

In a blog post Thursday evening, Uber CEO and co-founder Travis Kalanick reiterated the importance of classifying Uber drivers as independent contractors.

“Drivers value their independence — the freedom to push a button rather than punch a clock, to use Uber and Lyft simultaneously, to drive most of the week or for just a few hours,” he wrote. “That’s why we are so pleased that this settlement recognizes that drivers should remain as independent contractors, not employees.”

The settlement may make it easier for drivers to earn tips, which was a main issue in the original lawsuit. Drivers claimed Uber told passengers that tips were included in the fare, but the company did not actually give tips to the drivers. As part of the agreement, Uber will let drivers post signs in their cars stating, “Tips are not included, they are not required, but they would be appreciated.”

Uber also would no longer be able to kick drivers off the platform at will. Instead, drivers would be removed only for sufficient cause (not including accepting a low number of rides) and would most often receive warnings and the opportunity to correct problems. Drivers wishing to fight their removal could bring their concerns to an appeals panel made up of other Uber drivers.

And Uber drivers would be able to form a quasi union, dubbed a “driver association,” which will bring any grievances to management.

In January, Lyft agreed to pay $12.25 million to settle similar claims, but the court rejected the settlement as too low earlier this month.

Liss-Riordan called the Uber deal one of the largest ever achieved on behalf of workers claiming misclassification as independent contractors, and wrote it stands as a warning for other companies who improperly deny their workers employee benefits.

“As a result of this litigation, many companies have chosen to go the other way and not fight this battle,” she wrote, “and instead to classify their workers as employees with all the protections that accompany that classification.”