Uber had an eventful weekend. When Jeff Immelt, former CEO of GE, pulled out of the running for the position of new CEO at the ride sharing startup, it looked like it would be back to the drawing board for the company’s directors. But within a matter of hours, Dara Khosrowshahi, head of Expedia, pulled off a last minute victory in the contentious battle to run Silicon Valley’s most troubled company.

The new CEO will be taking over at a time when the company has been consumed with high-profilelawsuits, rampant allegations of sexual harassment, international regulatory fights, endless problems relating to its poor treatment of drivers, a beleaguered self-driving car unit, and manymore problems. The only upside at the moment is that the company is still growing and reducing the enormous losses it posts each quarter. Before he can even introduce himself to his new employees, however, Khosrowshahi will have to inform his current colleagues of his departure, something he reportedly intends to do today.

Despite HP CEO Meg Whitman’s definitive claims that she was out of the running to take over leadership at Uber just a few weeks ago, the New York Times reports that she was still in consideration up until the last minute on Sunday. Sources told Recode that Whitman was negotiating what sort of role company founder and former CEO Travis Kalanick would play if she took the job. One person with knowledge of the situation said that Whitman felt Kalanick “would be a great resource to any CEO and a helpful director, but not in any operational role.” According to Recode, Uber’s biggest investor, Benchmark Capital, preferred Whitman but Kalanick backed Khosrowshahi and got his way.

It’s a major victory for the young founder who has been the target of a lawsuit filed by Benchmark seeking to remove him from any decision-making in the future. That level of infighting among the board of directors is unusual for a company as high-profile as Uber and only added to the sense of urgency to choose a new CEO by the end of August. Now, Khosrowshahi will have to find a way to get all the parties to work together.

Advertisement

Khosrowshahi has run the online travel booking company Expedia since 2005 and his selection to take the reins at Uber represents a bit of a compromise. While he wasn’t Benchmark’s first choice, Rich Barton, the founder of Expedia, is a Benchmark partner. It would seem that Khosrowshahi will be starting out with some basic good will from all of the company’s directors.

Many lower and upper-level employees had hoped that a woman would be chosen for the CEO position to provide a counterbalance to the toxic, male-dominated culture that Kalanick and his fellow executives have built over the years. But one area that Khosrowshahi might satisfy employee’s wishes is in his vocal disparagement of the Trump administration. Kalanick controversially sat on Trump’s Business Council and the company came under fire in January when it appeared to take advantage of Trump’s chaotic travel ban announcement with surge pricing at airports. The #DeleteUber campaign prompted many people to cancel their accounts in protest. But Khosrowshahi’s family immigrated to the US when he was a child and he has spoken out against the administration’s treatment of immigrants from the beginning. In February, he ended a conference call with investors by referring to the dire circumstances the country faces under Trump and saying, “Hopefully we will all be alive to see the end of next year.”

Khosrowshahi is said to be well-liked at Expedia, where he accepted a $94.6 million agreement in 2015 to continue his leadership through 2020. Though he won’t be finishing out that deal, he’ll surely make more money than he could ever use at his new gig. Expedia’s market cap as a publicly traded company is currently around $23 billion while Uber is privately valued at close to $70 billion. Whoever holds the chief position at the startup when it decides to go public is expected to bank billions.

Advertisement

That payday won’t come until the company’s numerous problems are at least managed to the point of giving an appearance of stability. His first priority will have to be finding a resolution to what role Kalanick will play in the future. The company’s founder is believed to still have plenty of loyal colleagues and has often been rumored to be plotting a return to his old position. If Khosrowshahi can work out a solution to the lawsuit filed against Uber and Kalanick by Benchmark, it could go a long way towards conveying to investors that a steady hand has now taken the wheel.