SAN FRANCISCO >> Tempers flared in a packed courtroom Thursday as Uber battled to protect the business model that has made it the world’s most valuable startup and has fueled the growing on-demand economy.

More than 100 drivers, lawyers, journalists and spectators squeezed into the hearing in San Francisco federal court as attorneys sparred over an $84 million settlement that lets Uber avoid treating its drivers like regular employees.

Meanwhile, in a courtroom next door, another federal judge expressed concerns over a $27 million settlement proposed by Uber competitor Lyft in a similar case.

At the heart of the issue is how Uber, Lyft and other on-demand companies classify their drivers and couriers as independent contractors instead of employees. That business model allows the companies to avoid the cost of overtime pay and reimbursement for work expenses. And the issue doesn’t appear to be going away — a group of Uber drivers in New York filed yet another class action lawsuit Thursday accusing Uber of denying its drivers basic employee rights.

In San Francisco, U.S. District Judge Edward Chen did not indicate whether he will allow the $84 million Uber settlement to go forward, but he spent more than three hours grilling the lawyers who drafted the deal — heeding written objections from dozens of drivers and outside attorneys who view the settlement as a sell out. The line of questioning had Boston-based attorney Shannon Liss-Riordan, who represents drivers in the case, playing defense.

“A lot of objectors have lined up to cast objections at me — I wonder how they would have done it,” Liss-Riordan said, her voice rising as more than half a dozen lawyers crowded around her, eager to poke holes in her work. “It’s very easy to cast stones from the outside.”

In defending the settlement, Uber attorney Theodore Boutrous Jr. also may have provided new fodder for speculation about when the massive company will make its much-anticipated public market debut. The settlement will jump to $100 million if Uber is sold or has a successful initial public offering, though the company has not publicly acknowledged any such plans. During Thursday’s hearing, Chen asked how likely drivers are to see that extra $16 million.

“Without violating the securities laws,” Boutrous said, “I can tell you … it’s very likely that the drivers would obtain that based on public information about Uber and how it’s doing around the world.”

Several lawyers took issue with the settlement because it would block their own lawsuits against Uber. Los Angeles lawyer Mark Geragos, known for representing high-profile clients including Michael Jackson and singer Chris Brown, accused Liss-Riordan of improperly conspiring with Uber.

“It’s obvious what happened here,” he said, “Ms. Riordan decided she was going to go into a mediation with Uber, she was going to give global peace to Uber, and she was going to do it by … hijacking another case in this very courtroom. And that is what on its face shows collusion.”

Geragos represents former named plaintiff Douglas O’Connor, who recently withdrew his support from the settlement and cut ties with Liss-Riordan.

Geragos and other attorneys claim the settlement unfairly prohibits them from holding Uber accountable for failing to provide drivers with benefits including overtime pay, meal breaks and workers’ compensation pay — claims they say are worth much more than what Liss-Riordan got for them.

“The class deserves better than that,” said Palm Desert attorney Christopher Morosoff.

Chen seemed to agree that Liss-Riordan undervalued at least one claim, brought under the state’s Private Attorney General Act (PAGA).

“One could see this as a billions of dollars claim — even if it’s only $1 billion,” Chen said. “What you’ve allocated here is $1 million, which is one-tenth of one percent.”

In the Lyft case, U.S. District Judge Vince Chhabria worried plaintiffs lawyers left money on the table, but did not reveal whether he would ultimately allow the deal to proceed.

The Lyft case, in which drivers also sought reimbursement for driving expenses and other employee benefits, was complicated by the emergence of a new, eleventh-hour lawsuit. That new lawsuit, filed three weeks before Thursday’s hearing by San Francisco lawyer Jahan Sagafi, claims Lyft illegally withheld tips from drivers during peak “prime time” hours. Those claims weren’t included in the main Lyft lawsuit, but Sagafi fears they still would be barred under the current terms of the settlement. He estimates his claims could be worth as much as $60 million.

“If the plaintiff forgot an extremely valuable claim in negotiating the settlement,” Chhabria said, “that’s a problem.”

Marisa Kendall covers startups and venture capital. Contact her at 408-920-5009 and follow her at twitter.com/marisakendall.