By Asa Fitch and Aaron Tilley

Silicon Valley executives criticized President Trump's order suspending new immigration on several employment-based visas programs, warning it could damage the U.S. tech industry's competitiveness and ultimately jeopardize domestic job creation.

The temporary ban, announced Monday, includes the H-1B type of visa for high-skilled workers many tech companies employ. Apple Inc. Chief Executive Tim Cook, Tesla Inc. CEO Elon Musk and Sundar Pichai, boss of Google-parent Alphabet Inc., were among the executives who criticized the action. Mr. Cook on Tuesday said on Twitter he was "deeply disappointed by this proclamation." Amazon.com Inc. called the measure "short-sighted."

Tech companies are among the biggest employers of foreign workers in the U.S., leaning on the H-1B program to fill software development, engineering and other roles requiring specialized skills that aren't always widely available in the U.S.

Critics of the H-1B program say it has allowed companies to avoid hiring American workers in favor of cheaper foreign labor. The Trump administration said Monday's order would preserve jobs for unemployed Americans amid economic weakness -- and soaring unemployment -- stemming from lockdowns designed to contain the new coronavirus.

Microsoft Corp., Google, Apple, Facebook Inc., Intel Corp. and Cisco Systems Inc. each had thousands of H-1B visas approved last year, according to government data. Amazon and its cloud-computing subsidiary were among the largest recipients, together winning approval for more than 8,000 H-1B visas, which last for three years, in the 12 months through Sept. 30.

The new visa restrictions are set to take effect June 24 and last through the end of the year. They will keep hundreds of thousands of immigrants from coming to the U.S. for a wide range of work, from highly skilled engineering to manual labor.

Sarah Pierce, a policy analyst at the nonpartisan Migration Policy Institute, said companies could contest the order in court on the basis they already invested money on immigration fees and attorneys for the visa-approval process now cut short. Most new H-1B visas are granted in the spring through a lottery with an Oct. 1 start date. They typically cost thousands of dollars to process.

Tech companies have embraced remote work during the coronavirus pandemic, which could make it easier for them to cope with new immigration restrictions. Rich Lesser, CEO of Boston Consulting Group said that, given the success companies have had operating a distributed workforce, the visa order could lead some employers to locate more work abroad, denting job prospects domestically.

Microsoft President Brad Smith said Monday that now is "not the time to cut our nation off from the world's talent or create uncertainty and anxiety. Immigrants play a vital role at our company and support our country's critical infrastructure."

The administration's new policy will block about 167,000 visa holders and their family members from coming to the U.S. through the end of the year, in addition to another 158,000 people who get green cards but are blocked from coming until restrictions are lifted, the Migration Policy Institute estimates.

While tech companies are among the largest users of H-1Bs, outsourcing companies with their main operations in India, such as Tata Consultancy Services Ltd. and Infosys Ltd., dominate the approval numbers. Such companies make large numbers of applications for the visas and typically provide workers to U.S. companies that would rather not make permanent hires, an activity that has drawn scrutiny from U.S. authorities in the past.

U.S. tech executives say attracting skills from overseas has been crucial both for their companies and for the health of the industry as a whole. Silicon Valley's evolution into a world-leading tech cluster has hinged on foreign-born talent, and many of its top executives, including the CEOs of Microsoft, International Business Machines Corp. and Alphabet are foreign-born.

"In my experience, these skillsets are net job creators," Tesla Inc.'s South Africa-born Mr. Musk said. " Visa reform makes sense, but this is too broad," he posted on Twitter. Mr. Musk and the president have had a mixed history, agreeing on issues such as reopening the economy during the pandemic and disagreeing on climate change.

The number of visas allowed a year is capped at 65,000, although exemptions and additional quotas for people with advanced degrees from U.S. universities typically swell the number of work visas granted. A large portion of H-1B visas have gone to Indian workers historically. The Department of Homeland Security, in a report covering fiscal 2014 applications, said 70% of H-1B applicants were born in India.

The new restrictions send a message to talented workers overseas "that they're not welcome here," said Jyoti Bansal, an entrepreneur and investor who came to the U.S. in July 2000 on an H-1B visa. Mr. Bansal went on to found and sell his company, AppDynamics, to Cisco in 2017 for $3.7 billion, and now runs San Francisco-based Harness Inc. a software-delivery automation firm. His two firms have created around 3,000 jobs, he estimates.

"People have choices," he said. "There are tech ecosystems and startups in other countries, so they won't make a life decision to move to the U.S. That's a long-term loss to the U.S. economy."

Silicon Valley has a history of vocally battling the Trump administration over immigration policies. A swath of tech companies opposed Mr. Trump's ban on travel to the U.S. by citizens of several Muslim-majority countries early in his presidency and applauded court rulings that halted the measures.

Silicon Valley is grappling with a cooling of its once-hot job market, hit by layoffs among some of its hottest companies, including Uber Technologies Inc., Lyft Inc. and Airbnb. Layoffs and hiring freezes also have hit companies such as IBM and Hewlett Packard Enterprise Co., which are trying to restructure.

Other tech companies including Intel Corp., Twitter Inc. and YouTube, which is owned by Google, joined the chorus of tech voices against the immigration order. The Washington, D.C.-based Information Technology Industry Council said it would have a dangerous impact on economic recovery for years to come.

"When you restrict immigration, the jobs still get created, just somewhere else," Aaron Levie, the chief executive of Silicon Valley cloud-computing company Box Inc., said in a Twitter post. "And later down the road, when those individuals create the next Google, it won't be here."

--Lauren Weber and Michelle Hackman contributed to this article.