The tech industry’s opposition to President Trump escalated Thursday as corporate leaders drafted a letter warning of the economic risks of his immigration policies, Uber’s chief executive quit an administration advisory board, and Lyft pulled its ads from Breitbart News, the site founded by the White House chief strategist Stephen Bannon.

The developments followed remarks this week from Apple, Amazon and other companies, which said they were exploring legal action against Trump’s executive order that temporarily barred travelers from seven majority-Muslim countries. Amazon and Expedia also joined a lawsuit brought by the state of Washington against the immigration ban.

The actions underscored rising alarm along the West Coast’s tech archipelago from Silicon Valley to Seattle that Trump’s policies threaten a sector that has long been a driver of new wealth and innovation in an otherwise tepid economy. After attempting to reach out to Trump by attending a meeting at his hotel in New York, tech companies are readying themselves for a high-stakes confrontation with the president.

Trump’s quest to tighten immigration has struck particularly hard at left-leaning Silicon Valley, which relies on a flow of high-level talent from India, East Asia and elsewhere and sees diversity as core to its identity as an innovation hub.

“People come to Silicon Valley so they can build the American Dream, and this is one of the last places where the American Dream still kind of works,” said Jonathan Nelson, chief executive of Hackers/Founders, a 300,000-person global network of entrepreneurs and engineers. “If this happens, you’re going to completely kill the next 10 years of tech companies.”

Some tech companies are now mulling whether to move jobs out of the United States to places with more relaxed immigration policies, such as Vancouver. B.C., and Dublin, which have made clear they would welcome an influx of US-based immigrant technology workers.

“One of the sad ironies of this is that an administration that purports to understand business is threatening one of the core pillars of what has made Silicon Valley so successful and an engine of economic growth,” said Matt Mahan, chief executive of the social networking startup Brigade.

Tensions have been building since Friday night, when tech executives including Apple’s Tim Cook and Google’s Sundar Pichai began publicly denouncing the immigration ban. Protesters flooded US airports and held rallies outside Google’s offices. In a flurry of emails and late-night phone calls among top executives, the industry began preparing a range of responses.

Just over half of US startups that are estimated to be worth more than $1 billion were founded by immigrants, according to the Arlington think tank National Foundation for American Policy. And Silicon Valley is littered with immigrant success stories: Satya Nadella, the chief executive of Microsoft, is an immigrant from India; Google co-founder Sergey Brin is a refugee from the former Soviet Union; and Omid Kordestani, Twitter’s executive chairman, was born in Iran.

Apple co-founder Steve Jobs was the son of a Syrian immigrant, leading Cook to say, in a letter denouncing Trump’s travel ban, that the company “wouldn’t exist” if such a ban had been in place.

Sam Altman, the president of the Silicon Valley Y-Combinator, called the reaction to the immigration ban a watershed moment in which the tech industry – rivals and all – made the unusual move of coming together and drawing a line in the sand against a sitting president.

The steps taken by tech companies become more urgent after a draft of what appeared to be a Trump administration executive order limiting workers on H-1B visas circulated widely in Silicon Valley this week.

AThe leaked order indicated the administration could cancel the annual lottery through which technology companies sponsor tens of thousands of engineers, as well as a special visa for start-up founders who want to move to the United States.

A spokesman for the White House declined to comment on the leaked order or confirm its veracity. But White House press secretary Sean Spicer told reporters this week that the administration expects to scrutinize work-visa programs closely as part of its immigration agenda.

“There’s an overall need to look at all of these programs,” said Spicer. “And you’ll see both through executive action and through comprehensive measures a way to address immigration as a whole and the visa program.”

As tensions built throughout the week, Uber chief executive Travis Kalanick and Tesla’s Elon Musk, who serve on Trump’s economic council, faced intense pressure to disavow their work with the administration, according to people familiar with the situation. Both have insisted, until now, that being at the table and having the opportunity to influence the direction of the country was better than not doing so.

But on Thursday, Kalanick said that he had spoken with Trump and told him that he would step down. Musk declined requests for comment.

Kalanick’s calculus changed after the company faced a huge outcry from the public for not joining Saturday’s protests at airports.

In his letter, Kalanick said he made his decision after hearing the stories of Uber employees and drivers, singling out Emil Michael, a refugee from Egypt, and Thuan Pham, a refugee from Vietnam.

Kalanick wrote the executive order was “hurting people across America, and hurting Uber’s ability to make positive change in the country. “The implicit assumption that Uber (or I) was somehow endorsing the Administration’s agenda has created a perception-reality gap between who people think we are, and who we actually are,” he wrote. “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.”

In separate letter, more than 115 Silicon Valley startup founders and venture capitalists pleaded with the administration to cancel the immigration ban.

“Silicon Valley flourishes because of our free and open culture of entrepreneurship and excellence,” they wrote. “The President’s actions yesterday not only negatively affect Tech’s competitiveness, they hurt the US economy overall.”

Another letter from executives at Facebook, Google, Microsoft, Apple and others is also being drafted, according to a person familiar with the deliberations who spoke on the condition of anonymity to discuss the private matter.

In interviews, technology company officials said they were looking into relocating people to overseas offices in Ireland and other places in Europe. The officials spoke on the condition of anonymity because the deliberations were still underway.

“Tech companies are telling me they would rather set up subsidiaries or set up their companies in countries that are more welcoming and have friendlier immigration laws,” said Priya Alagiri, an immigration lawyer based in San Francisco who represents startups and tech firms. They go to great lengths [to keep immigrant workers] because the workers are so highly talented and highly skilled.”

Meanwhile, Lyft, Uber’s ride-hailing rival, said Thursday that it was pulling ads from Breitbart News, following the actions of hundreds of other companies including Lenovo, HP, and T-Mobile. Many of the firms criticised the site for being an anti-immigrant and racist platform.

“One of Lyft’s core values is to uplift and support one another in all that we do,” said Adrian Durbin, Lyft’s director of communications. “We strive to ensure that our advertisements appear only on sites that share this value.”