Washington, DC CNN Business  — 

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 and invest $400 million in the Silicon Valley-based startup that makes software for autonomous vehicles and lists Amazon among its investors.

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.

Uber (UBER) founded its self-driving efforts in 2015 in Pittsburgh when it poached 40 researchers from Carnegie Mellon University. The operation, called Uber (UBER) ATG (Advanced Technologies Group), would later grow to over 1,000 employees.

Uber believed developing self-driving cars was essential for it to survive, given that self-driving cars might 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. “That’s just the way of the world. That’s the way of technology and progress. Unfortunately we all have to find ways to change with the world.”

But now Uber, which cut 25% of its staff during the pandemic, expects the deal to reduce its costs and contribute to its plan to be profitable excluding certain costs in 2021.

Uber bulked up its self-driving team in 2016 when it bought self-driving truck startup Otto, which was co-founded by a former Google autonomous vehicle employee, Anthony Levandowski.

Waymo, Google’s self-driving company, sued Uber in February 2017 alleging trade secret and intellectual property theft, and Levandowski was fired from Uber that May after failing to cooperate with the company on the case. The suit was settled in February 2018, with Waymo receiving about $245 million in Uber stock, and Uber agreeing not to use proprietary Waymo information.

Uber suffered another blow to its self-driving program a month later when one of its test vehicles in Tempe, Arizona, struck and killed a pedestrian. An Uber test driver behind the wheel, who was supposed to monitor the vehicle and intervene if needed, was watching a television show on her phone.

Following the fatality, Arizona governor Doug Ducey suspended Uber’s ability to test on state roads, and Uber shut down its operations there in May 2018. Three hundred workers were laid off, but Uber continued operations in San Francisco and Pittsburgh.

The National Transportation Safety Board blamed the distracted driver for the crash, but said an inadequate safety culture at Uber contributed to the death. Uber made significant changes following the crash, which the NTSB credited.

The death was the first fatality caused by a fully self-driving vehicle, and a black eye for an industry that’s listed safety as one of its primary motivations. More than 35,000 Americans die on roads each year, and self-driving companies believe their technology can dramatically improve safety.

Urmson, Aurora’s CEO, said in a blog post Monday that Uber ATG’s safety work was among the reasons it acquired Uber ATG.

“Throughout the last several years, they’ve also worked tirelessly to build an experienced safety team with diverse backgrounds,” Urmson said.

He also said Uber’s expertise in ridehailing give Aurora an opportunity to lead the industry in passenger mobility.

Not all of Uber’s employees in Uber ATG will make the transition to Aurora, including its CEO Eric Meyhofer. Aurora has committed to making offers to the majority of ATG employees, according to an Uber spokesperson.

The deal is expected to close in the first quarter of 2021, according to an Aurora spokesperson. Uber CEO Dara Khosrowshahi will join Aurora’s board of directors. Uber’s stock was down less than a percent Monday, following the close of markets.

The partnership will also give Aurora a connection with an auto manufacturer, Toyota, which has invested in Uber ATG. While Aurora is developing sensors and software for self-driving vehicles, it will need a partner to manufacture the vehicles. Aurora competitors such as Waymo, Cruise and Argo AI, have all made deals with automakers. Toyota did not immediately respond to a request for comment.