Uber is selling its self-driving car division to the autonomous vehicle startup Aurora, ending a five-year run of developing self-driving vehicles that was marred by litigation and a fatal crash.

Uber will take a 26% stake in Aurora — which is backed by Amazon and Sequoia Capital — and invest $400 million in the Silicon Valley-based startup, which makes software for autonomous vehicles.

Aurora CEO Chris Urmson previously led Google’s self-driving car program. Uber and Aurora say they’ve also struck a strategic partnership to deploy self-driving cars powered by Aurora on the Uber app.

The sale brings a close to Uber’s ambitious efforts to develop a fleet of self-driving cars that could ferry passengers around cities. It held that developing self-driving cars was essential for its survival, given that autonomous vehicles could eventually make human-driven vehicles expensive and irrelevant.

“If Uber doesn’t go there, it’s not going to exist either way,” Uber founder Travis Kalanick said in a 2014 interview at the Code Conference.

Uber will also invest $400 million into Aurora, and Uber’s CEO Dara Khosrowshahi will join Aurora’s board of directors.

After the transaction, Aurora will be worth $10 billion, Urmson said in an interview.

“Our first product will be in trucking and freight, but we look forward to taking this great team that we have and accelerating that while continuing working on light vehicles and ride-haling, and we’ll ultimately see our vehicles deploying on the Uber network,” Urmson said.

Uber will not have exclusive rights as a ride-hailing company to Aurora’s technology, but the two companies will have a “preferred relationship,” Urmson said.

San Francisco-based Uber will lose a critical piece of its company after the pandemic cut into its finances by suppressing demand for shared rides. Its path to profitability has often been linked with its plans to deploy autonomous vehicles and reduce the high cost of paying drivers.

The company’s efforts around self-driving technology was marred in March 2018 when one of its automated test vehicles hit and killed a woman, the first death involving the technology. The backup Uber driver involved in the crash was charged with negligent homicide for being distracted in the moments before fatally striking the woman in suburban Phoenix.

“There’s no doubt they had a pretty rough couple of years a while back,” Urmson said. “What’s been impressive to me in meeting the team over the last little while is just how much the team has learned, and the tenaciousness, and determination of the team as they come to market in a thoughtful, safe way.”

Gaining customers’ trust is a huge factor, said Dan Morgan, vice president of Synovus Trust Company. “You have one or two bad accidents and people are like, ‘I’m not getting into that thing,'” he said.

Aurora, based in Mountain View, Calif., is led by former Google, Tesla and Uber executives. Aurora also has partnerships with delivery giant Amazon and auto companies Hyundai and Kia, among others, but its partnership with Uber is its first official relationship with a ride-hailing company.