Expedia chief executive Dara Khosrowshahi is poised to become the next CEO of Uber. (Lucas Jackson/Reuters)

SAN FRANCISCO — Uber has selected Dara Khosrowshahi, the chief executive of Expedia, as its new leader, a surprising turn after board members considered two other stalwarts of industry, two people with direct knowledge of the matter said Sunday.

The move comes after a weekend of frantic meetings with two other final candidates, Meg Whitman, chief executive of Hewlett-Packard Enterprises, and Jeff Immelt, the departing chief executive of GE. Immelt made it clear the job would not be his in a tweet Sunday. And a divided board shifted between Whitman and Khosrowshahi throughout the weekend, said the people, who spoke on the condition of anonymity to discuss private meetings.

Khosrowshahi, 48, an Iranian American who has run Expedia since 2005, was an unexpected and lesser-known choice; his interest in the position was largely kept secret until Sunday. The agreement came together only in the past few days, such that even family members and close friends of Khosrowshahi were surprised by the news.

But within Silicon Valley, Khosrowshahi is well liked and respected. He has presided over a huge expansion of the online travel company to more than 60 countries. He also is a vocal critic of President Trump, particularly his travel ban against Muslim Americans.

People who know Khosrowshahi said he will bring two assets to Uber. For one, he is considered even-keeled and low-key — a sharp contrast to Travis Kalanick, Uber's former chief executive and co-founder, who has been known to fly into fits of anger. (In one infamous episode that was caught on video earlier this year, Kalanick unloaded on an Uber driver who criticized the company’s wages.)

“My whole life, anytime I've faced a high-pressure decision, my model for mature behavior has been, 'What would Dara do'? He's one of the humblest and most even-keeled people I know,” said Ali Partovi, an entrepreneur and technology investor who is Khosrowshahi’s second cousin. The two went to primary school together in Iran.

Khosrowshahi’s other asset is his skill as a dealmaker in the highly competitive market for online travel. He has expanded Expedia into an even larger online travel conglomerate by acquiring other consumer brands, such as booking sites Travelocity and Orbitz, and home rental site HomeAway.

That instinct for homing in on competitors in related or similar businesses may serve Uber, which faces brutal competition from Lyft as well as other ride-sharing start-ups in developing countries, and the taxi industry, which in some cities has created copycat ride-sharing apps. Uber is leveraging its network of drivers to expand into trucking and food delivery.

Uber is the most highly valued start-up Silicon Valley has produced over the past decade, and it is expected to move toward a massive public stock offering in the coming year or so.

Khosrowshahi will face a company in crisis. He is tasked with transforming the company’s culture, while shoring up its business in the wake of lawsuits and competition, analysts say. Morale at Uber has plummeted in the wake of eight months of controversy, including reports of widespread discrimination and sexual harassment, lawsuits that threaten the company’s future, a leadership vacuum, and the ouster of Kalanick.

Uber revealed that it knew about a breach affecting 57 million users for an entire year before revealing it to the public. It is just one of the many controversies Uber has had in 2017, from #DeleteUber to accusations of technology theft. Here are all the controversies in one place. (Daron Taylor,Jhaan Elker/The Washington Post)

The executive search has lasted all summer and been marred by infighting among board members. After Kalanick was pushed out, he scrambled to find allies who would help him make a comeback, the people with knowledge of the matter said. That led Benchmark Capital, one of the company’s largest investors, to sue Kalanick for breach of contract and fraud, arguing in court filings that Kalanick was seeking to entrench himself in the process for his own “selfish ends.”

Kalanick fired back in his own legal filings, calling the Benchmark suit a baseless and “personal attack.” Meanwhile, the board disagreed with the Benchmark suit, releasing a statement signed by all members except Benchmark representative Matt Cohler that it was “disappointed that a disagreement between shareholders” has resulted in litigation.

Read more about Uber: 

What to know about Uber’s months of crises

Arianna Huffington’s fix for Uber: Work less, sleep more

The big problem for Uber now: Attracting talent