Uber and Waymo have reached a settlement in their trade secrets lawsuit, lawyers for the companies told a federal court in San Francisco Friday morning.

Waymo, which was Google's self-driving car program, had alleged its former engineer Anthony Levandowski downloaded autonomous vehicle trade secrets and took them to Uber.

Waymo accepted a settlement offer from Uber, which agreed to a deal that includes 0.34% of Uber's equity at a $72 billion valuation, which works out to about $245 million, two sources familiar with the matter said. Waymo had initially asked for maximum damages of $1.8 billion.

Google already has equity in Uber. Google invested $258 million in Uber in 2013 and integrated Uber into Google Maps the following year.

A gasp could be heard in the courtroom when attorneys announced the settlement. Presiding Judge William Alsup noted after the announcement that a settlement like this, in the middle of a trial, is rare.

"We have reached an agreement with Uber that we believe will protect Waymo's intellectual property now and into the future," a Waymo spokesperson said in a statement. "We are committed to working with Uber to make sure that each company develops its own technology. This includes an agreement to ensure that any Waymo confidential information is not being incorporated in Uber Advanced Technologies Group hardware and software."

Related: How Uber and Google went from 'brothers' to enemies

The investigation into potential trade-secret theft began in late 2016 when Waymo accidentally received an email from a supplier containing an attachment that detailed Uber's LiDAR circuit board. Waymo claimed it looked suspiciously like its own design.

LiDAR, or "Light Detection and Ranging," uses pulsating laser beams to measure the distance between objects and can be used to make three-dimensional representations of them. It's crucial to self-driving car development. Waymo alleged that Levandowski took Google trade secrets related to this technology to Uber.

Uber CEO Dara Khosrowshahi said in a statement Friday that the company should have handled the acquisition of Otto, a self-driving truck company founded by Levandowski, differently. Khosrowshahi said Uber does not believe any trade secrets made their way to Uber, however.

"But the prospect that a couple of Waymo employees may have inappropriately solicited others to join Otto, and that they may have potentially left with Google files in their possession, in retrospect, raised some hard questions," he wrote.

Levandowski was expected to testify late Friday or early Monday. The case was likely to go through next week.

Former Uber CEO Travis Kalanick said in a statement that evidence at trial showed no trade secrets got to Uber.

"[H]ad the trial proceeded to its conclusion, it is clear Uber would have prevailed," he said.

According to Justin Hughes, an intellectual property law professor at Loyola Law School Los Angeles, it may have been difficult for Waymo attorneys to prove that Uber used the trade secrets Levandowski allegedly stole. That's because California has strong protections for employees to take their skills and knowledge to different companies, and the bar to prove misappropriation of trade secrets is high.

Hughes also said it's evident Google doesn't have a direct route into the self-driving car market like Uber running an on-demand ride service or General Motors manufacturing cars.

"It's possible [Waymo is] thinking that by taking an equity stake in Uber, they are changing their place at the table," Hughes said. "Instead of gambling that Uber has to fail completely, they're taking a new gamble that Uber will fail in self-driving technology, but want to deploy a self-driving fleet -- and be a customer in need of Waymo's technology."

Google's parent company Alphabet is now invested in Uber through two different divisions: Waymo and Google Ventures. It also led a $1 billion round in Lyft through CapitalG, another venture capital arm.