SAN FRANCISCO — Travis Kalanick needed everyone to take a deep breath.

The chief executive of Uber was holding a regularly scheduled all-hands meeting on Tuesday at the ride-hailing company’s San Francisco headquarters when he faced an onslaught of questions from upset employees.

Uber was under attack — unfairly, many staff members believed — after people accused the company of seeking to profit from giving rides to airport customers in New York during weekend protests against President Trump’s immigration order.

But there was another matter disturbing the employees: Mr. Kalanick himself. He had joined Mr. Trump’s economic advisory council in December. After the immigration order against refugees and seven Muslim-majority countries, many staff members wondered why Mr. Kalanick was still willing to advise the president.

“What would it take for you to quit the economic council?” at least two employees asked at the Tuesday meeting.

On Thursday, Mr. Kalanick gave his answer, stepping down from Mr. Trump’s economic advisory council. “There are many ways we will continue to advocate for just change on immigration, but staying on the council was going to get in the way of that,” Mr. Kalanick wrote in an email to employees obtained by The New York Times.

Mr. Kalanick’s exit from the advisory council underscores the tricky calculus facing many Silicon Valley corporate chieftains who try to work with the new administration. On one hand, many tech executives have openly tried to engage with the president, a path that is typically good for business. Yet Mr. Trump’s immigration order has been so unpopular with so many tech workers — many of whom are immigrants themselves and who advocate globalization — that they are now exerting pressure on their chief executives to push back forcefully against the administration.

Thirty miles south of Uber’s headquarters, for example, Facebook employees have voiced frustration that Peter Thiel, the billionaire tech investor and adviser to Mr. Trump, still has a seat on the social network’s board. At Google, employees have staged protests against the immigration order. At Twitter’s headquarters, some employees have said they are uneasy about the president’s heavy reliance on their service to send divisive messages.

The tension over continuing to work with Mr. Trump reached a breaking point at Uber because Mr. Kalanick was, until Thursday, one of the most vocal proponents among tech chiefs of engaging with the president. As recently as Saturday, Mr. Kalanick had publicly said in a blog post that the best route forward was to have “a seat at the table.” He had added, “We partner around the world optimistically in the belief that by speaking up and engaging we can make a difference.”

Outside of the internal pressure, Uber faced other fallout from Mr. Kalanick’s stance. More than 200,000 customers had deleted their accounts.

In addition, Uber rivals had seized the moment to attack the company and bolster their own businesses. The New York Taxi Workers Alliance sent emails to the news media calling attention to Uber’s ties to Mr. Trump, and organized a protest at Uber’s New York office for Thursday. Lyft, another ride-hailing service, pledged to donate $1 million to the American Civil Liberties Union and has seen its app shoot toward the top of the download charts.

Uber drivers, many of them immigrants who work for the ride-hailing company on a freelance basis, were also upset.

Document | Uber Chief’s Email to Employees Email from Travis Kalanick, chief of Uber, announcing that he was stepping down from President Trump’s economic advisory council.

“There would be no Uber without immigrants,” said Jim Conigliaro Jr., founder of the Independent Drivers Guild, an organization that represents and advocates protections for nearly 50,000 Uber drivers serving New York City. “As a company whose success is built on a foundation of hard work by immigrant workers, Uber can and should do better to stand up for immigrants and their workers.”

Uber has set aside $3 million for a legal-defense fund to support drivers, offering help with translation services and round-the-clock telephone access to legal aid.

For Mr. Kalanick, the moment was especially fraught. Other corporate chiefs, including Elon Musk of Tesla and SpaceX, and Mary Barra of General Motors, are also on the president’s economic advisory team. Mr. Musk said on Twitter this week that the group of economic advisers planned to come to some sort of “consensus” on immigration, and to influence Mr. Trump by engaging directly with him rather than cutting off ties completely.

“Travis and the other C.E.O.s are on that (presidential) board for one simple reason: To advance their business interests,” said Dan O’Sullivan, a writer from the Chicago area who helped to spread the #DeleteUber campaign on social media.

Internally, Uber staff members also began piling on the pressure. According to nearly a dozen current and former Uber engineers and product managers who attended or were briefed on the Tuesday all-hands meeting, employees said they were concerned that Mr. Kalanick’s willingness to work with Mr. Trump after the immigration order would color Uber as a soulless company that cared only about its bottom line.

Some told Mr. Kalanick that they had suffered a personal cost — a stigma, they said — of working at Uber. One staff member asked him to present the benefits of working at Uber that could outweigh that personal cost.

Mr. Kalanick replied that he believed that change could be best effected through engagement, and through the work they did every single day.

Many employees were not satisfied with his answer. On Wednesday, Uber staff members followed up by circulating a 25-page Google document titled “Letters to Travis” to tell the chief executive how and why his willingness to engage with the administration had affected them.

By Thursday morning, Mr. Kalanick had reversed his position on engaging with Mr. Trump. His participation in the economic advisory council had created what he called a “perception-reality gap between who people think we are, and who we actually are.”

In his email to employees, he said his participation was being interpreted as a sign that he had endorsed the president and the administration’s agenda. In fact, Mr. Kalanick said, the immigration order was hurting many people across America.

“Immigration and openness to refugees is an important part of our country’s success and quite honestly to Uber’s,” he wrote.

Mr. Kalanick said he had spoken briefly with Mr. Trump to let him know he was withdrawing from the advisory council.

“Please know, your questions and stories on Tuesday, along with what I heard from drivers, have kept me resilient and reminded me of one of our most essential cultural values, Be Yourself,” Mr. Kalanick wrote.