Ride-hailing giant Uber has settled its legal battle with self-driving car development company Waymo over the alleged theft of trade secrets.

As part of the settlement, Uber has agreed to pay $245m (£177m) in the form of a 0.34 per cent stake in the company to Waymo, which is the driverless car arm of Google's parent company Alphabet.

The Silicon Valley lawsuit started in early 2017 after Uber was accused of using at least one of Waymo's trade secret in its self-driving vehicles.

This came after Uber had purchased Otto, a self-driving trucking company co-founded by former Google employee Anthony Levandowski, for $650m in 2016.

Uber has agreed not to use Waymo's technology in its self-driving cars, although CEO Dara Khosrowshahi maintains that the company never did. However he admitted that the deal involving Otto "should have been handled differently".

"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," he wrote in a published statement.

"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."

He added: "There is no question that self-driving technology is crucial to the future of transportation - a future in which Uber intends to play an important role. Through that lens, the acquisition of Otto made good business sense.

"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.

"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.

"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."