Uber Technologies Inc. agreed to give Waymo about $245 million in closely held stock to cut short a trade-secret theft trial, ending a high-stakes conflict that already cost the ride-hailing giant its top driverless car engineer and threatened to further embarrass the company.

The deal will give the Alphabet Inc. driverless-car unit 0.34 percent of Uber equity, Waymo said. The actual value of those illiquid shares will depend on how Uber is valued when it goes public — something the company has said it aims to do in late 2019. SoftBank Group Corp. just completed a $9.3 billion deal with Uber in which it valued Uber’s shares at a blended $54 billion valuation. At that price, the settlement is worth $184 million. Alphabet already owns Uber shares since it invested in the company in 2013.

The court showdown captivated Silicon Valley during a year in which Uber weathered multiple scandals that drove co-founder Travis Kalanick out of his job as chief executive officer. Uber and Waymo are rivals in the nascent automated driving industry, which both companies believe to be worth hundreds of billions of dollars a year in revenue.

Waymo alleged that one of its senior engineers, Anthony Levandowski, hatched a plan in 2015 with Uber for him to steal more than 14,000 proprietary files, including the designs for lidar technology that helps driverless cars see their surroundings. In four days of testimony this week, of which Kalanick spent three hours on the stand, it became clear how difficult it would be to prove those claims.

“Waymo had already achieved most of what it needed, and Uber, with a fundamental change in management, no longer had the emotional investment that would justify carrying on the fight,” said Jim Pooley, a trade-secrets expert who has followed the case. “Litigation is measured by a cost/benefit analysis, and the costs here — not just the money but the diversion of attention from more important things — came to obviously exceed the benefits to either side.”

Dara Khosrowshahi, Uber’s CEO, said in a letter Friday his job is to set the course for the future of the company and expressed regret over the ordeal.

“To our friends at Alphabet: we are partners, you are an important investor in Uber, and we share a deep belief in the power of technology to change people’s lives for the better. Of course, we are also competitors. And while we won’t agree on everything going forward, we agree that Uber’s acquisition of Otto could and should have been handled differently.”

Working With Uber
A spokesman for Waymo said the company “reached an agreement with Uber that we believe will protect Waymo’s intellectual property now and into the future. We are committed to working with Uber to make sure that each company develops its own technology.”

Uber bought Otto, the company Levandowski formed just before he quit Waymo in January 2016, in a deal valued at more than $600 million in stock. Most of that sum hasn’t been paid because the value was based on meeting target goals. Levandowski became head of Uber’s self-driving project, but was demoted, and eventually fired, as the litigation heated up. Levandowski, who isn’t a defendant in the lawsuit, refused to answer questions from Waymo and turn over documents, citing his constitutional right against self-incrimination.

U.S. District Judge William Alsup ratcheted up the risk for Uber when he asked federal prosecutors in May to investigate Waymo’s claims. He said Waymo made a compelling showing that Levandowski absconded with its files and that Uber “knew or should have known” that when it brought him aboard.

Waymo was seeking as much as $1.86 billion in damages and a court order barring Uber from using the technology in dispute.

The case is Waymo LLC v. Uber Technologies Inc., 17-cv-00939, U.S. District Court, Northern District of California (San Francisco).