SAN FRANCISCO — Waymo and Uber settled their legal fight on Friday, nearly a year after Waymo first accused the ride-hailing company of plotting to steal important self-driving car technology.

After four days of arguments and testimony in Federal District Court here, Uber agreed to provide Waymo, the self-driving car unit under Google’s parent company, Alphabet, with 0.34 percent of its stock. According to Waymo, the settlement’s terms value Uber at $72 billion, meaning the Alphabet unit’s stake is worth about $245 million.

The settlement closes a legal fight that riveted Silicon Valley. It pitted the most successful company from the dot-com era against this generation’s biggest start-up in a fight over autonomous vehicles — a potentially trillion-dollar industry that is expected to transform transportation.

The trial also offered a peek into how Silicon Valley really works: the rise of promising start-ups that challenge incumbents; the inner workings of rich, but often chaotic, technology companies; the complicated rivalries among billionaire tech entrepreneurs; and the costly competition for engineering talent.