SAN FRANCISCO — Uber chose Dara Khosrowshahi, who leads the online travel company Expedia, to be its chief executive on Sunday, two people with knowledge of the decision said. The selection capped a contentious search process as the ride-hailing company seeks to move past a turbulent period.

Mr. Khosrowshahi emerged as the leading candidate from a field of three finalists over a weekend of Uber board meetings, said the people, who spoke on the condition of anonymity because the details were confidential.

One finalist, Jeffrey R. Immelt, the former chief of General Electric, withdrew on Sunday when it became clear that he did not have enough support, said two people familiar with the process.

The board of directors and executives inside of Uber had instead been leaning toward Meg Whitman, the chief of Hewlett Packard Enterprise, the people said. But matters changed quickly over the course of Sunday afternoon, as directors and Ms. Whitman could not agree on terms in which she would take over as chief executive, the people said. Ultimately, the board decided on the third candidate, Mr. Khosrowshahi.