Uber has settled its courtroom battle with Alphabet's self-driving car unit Waymo.

Uber will pay Waymo a 0.34 percent equity stake amounting to about $245 million at Uber's recent $72 billion valuation, the companies said Friday, after days of courtroom theatrics.

Uber has also agreed not to incorporate Waymo's confidential information into its hardware and software, though Uber CEO Dara Khosrowshahi writes in a statement that he doesn't believe his company used any of Waymo's trade secrets in the first place.

A source familiar with the matter tells CNBC that Uber approached Waymo with a settlement offer within a week before the trial started.

A second source says that before the current settlement was reached, there was another offer with a higher equity value given to Waymo (around $500 million) and that had fewer constraints on Uber about the use of Waymo technology, but that Uber's board rejected that offer at a meeting Tuesday night. This source adds that company lawyers continued to talk and came to the ultimate settlement, which didn't involve Uber's board.

Khosrowshahi also says that he feels "regret" over the dispute and wished his predecessors had handled it differently.

"[T]he 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. "To be clear, while we do not believe that any trade secrets made their way from Waymo to Uber, nor do we believe that Uber has used any of Waymo's proprietary information in its self-driving technology, we are taking steps with Waymo to ensure our Lidar and software represents just our good work."

Khosrowshahi also wrote that he saw Alphabet as a valuable partner and hopes to end the distracting case for the sake of his own engineers. Because Waymo now owns a stake in Uber, the two companies are, ironically, brought closer after their yearlong legal battle. (Alphabet also owns a stake in Uber through its venture capital arm, GV.)

"We are committed to working with Uber to make sure that each company develops its own technology," a Waymo spokesperson said. "This includes an agreement to ensure that any Waymo confidential information is not being incorporated in Uber Advanced Technologies Group hardware and software."

The case started in February 2017 when Waymo accused Uber of using at least eight Waymo trade secrets in its self-driving cars. Waymo said that when Uber acquired the start-up Otto, founded by star Google engineer Anthony Levandowski, in late 2016, Levandowski brought some 14,000 Google files with him, some of which contained Waymo trade secrets. Uber rebutted that its self-driving sensor designs were unique and that Levandowski's actions were unrelated to his work at Uber.

In the end, Uber's settlement with Waymo doesn't require it to pay out a particularly large sum of money or change its self-driving car plans, but the yearlong litigation still brought to light many unflattering details about the company's business practices and its former CEO, Travis Kalanick. Waymo's legal team has tried to paint Uber and Kalanick as desperate to catch up to its self-driving car efforts "at all costs."

Kalanick said in a statement that no trade secrets came to Uber, and that "it is clear Uber would have prevailed," if the trial had continued.

"I remain proud of the critically important contributions Uber ATG has made to the company's future," Kalanick said.

Meanwhile, the proceedings also highlighted correspondence from within Alphabet that showed that the company was fretful about losing its lead in the driverless car space as it bled talent and faced new competition. Uber's legal team tried to position Waymo's lawsuit against it as an act of vindictiveness.

Ultimately, the settlement gives both sides a bit of what they wanted, while neither Waymo nor Uber is likely completely satisfied.