SAN FRANCISCO — Five days into an epic court battle that was expected to last for weeks, Uber abruptly settled a lawsuit Friday brought by Waymo, part of Google parent Alphabet, over the alleged theft of trade secrets.

As part of the deal, company officials said, Uber has agreed to pay 0.34 percent of the company’s equity at a $72 billion valuation — a sum that exceeds $244 million.

The deal also includes a guarantee that Uber will not incorporate confidential Waymo self-driving-car technology into Uber’s hardware and software, a Waymo spokesman said.

The deal was announced in a San Francisco federal court before testimony began, shocking many in the audience and leading to a rapid succession of prepared statements from each side.

Uber chief executive Dara Khosrowshahi released a statement saying he wants to “express regret” and commit Uber to taking steps to ensure that its self-driving technology “represents just our good work.”

In a statement released Friday, Waymo — which had accused Uber of stealing numerous trade secrets that were embedded in Waymo’s self-driving-car technology — said it thinks the binding agreement will protect its intellectual property in the future. Waymo had been seeking damages of at least $1 billion.

“We are committed to working with Uber to make sure that each company develops its own technology,” the statement said. “We have always believed competition should be fueled by innovation in the labs and on the roads and we look forward to bringing fully self-driving cars to the world.”

The settlement followed four days of testimony from Waymo and Uber employees, including former Uber chief executive Travis Kalanick, who was accused of recruiting star Google engineer Anthony Levandowski to Uber to steal Google’s intellectual property. (Kalanick stepped down last year amid accusations that Uber was rife with sexual harassment and a culture of misogyny.)

Kalanick forcefully denied those allegations during his court appearance Wednesday, arguing that his pursuit of top-tier engineering talent was a way of advancing driverless technology and ensuring Uber’s survival.

“We hired Anthony because we felt that he was incredibly visionary, a very good technologist, and he was also very charming,” Kalanick said, noting that the goal was to “make driverless cars a reality.”

Waymo called multiple witnesses to the stand in an attempt to establish that Levandowski successfully stole 14,000 confidential files relating to the design of self-driving cars from Google and that Uber knew he was tainted with troves of proprietary information after he had left Google.

Levandowski might have been called to the stand Friday, where he was expected to invoke his Fifth Amendment right against self-incrimination, a possibility that might have significantly blemished Uber’s case, some observers noted.

Behind the scenes, company officials admit, negotiations were taking place. Uber’s board rejected a proposed settlement valued at $500 million earlier in the week, according to Reuters.

Waymo filed a lawsuit nearly a year ago accusing Uber of conspiring with Levandowski to create a fake company that would be purchased by Uber and used to steal eight trade secrets from Google’s self-driving-car team. Uber bought Levandowski’s start-up, Otto, for $680 million in 2016.

The goal was not only to “leapfrog” Google in the race to build self-driving cars, Waymo lawyers alleged, but also to keep Uber alive.

“We agree that Uber’s acquisition of Otto could and should have been handled differently,” Uber said in its statement.

Khosrowshahi’s statement added that Uber does not think that his company acquired trade secrets from Waymo or used any proprietary information in its self-driving technology.

“While I cannot erase the past, I can commit, on behalf of every Uber employee, that we will learn from it, and it will inform our actions going forward,” Khosrowshahi wrote.

Uber’s legal battle with Waymo may be over, but the U.S. Department of Justice has launched a criminal probe into the company’s alleged theft of trade secrets.

Kalanick remained adamant in a statement Friday that facts of the case were on Uber’s side.

“As Uber’s statement indicates, no trade secrets ever came to Uber,” the statement said. “Our sole objective was to hire the most talented scientists and engineers to help lead the company and our cities to a driverless future. The evidence at trial overwhelmingly proved that, and had the trial proceeded to its conclusion, it is clear Uber would have prevailed.”

Read more: