Some of Silicon Valley’s biggest names have joined the court fight against President Trump’s immigration restrictions, as heavyweights like Apple, Google and Facebook warned that the limits could hurt the country’s economy.

In a filing to a federal appeals court dated Sunday, nearly 100 technology companies argued that Mr. Trump’s temporary ban on all visitors from seven predominantly Muslim countries would hurt their businesses and violate both immigration law and the United States Constitution. A lower court on Friday temporarily halted crucial parts of the ban, but the Trump administration said it would fight to have them reinstated.

“The tremendous impact of immigrants on America — and on American business — is not happenstance,” the companies said in a friend-of-the-court filing. “People who choose to leave everything that is familiar and journey to an unknown land to make a new life necessarily are endowed with drive, creativity, determination — and just plain guts.”

Document | Tech Industry’s Filing Against Travel Ban Nearly 100 technology companies said that President Trump’s temporary ban on all visitors from seven predominantly Muslim countries would violate both immigration law and the United States Constitution.

“The energy they bring to America,” it said, “is a key reason why the American economy has been the greatest engine of prosperity and innovation in history.”

Trump administration officials were not immediately available to comment late Sunday. The issue is set to be considered this week by the United States Court of Appeals for the Ninth Circuit, based in San Francisco.

In addition to Apple, Facebook and Google, major technology names that signed the brief included Microsoft, Uber, Twitter, Airbnb, Intel and Snap, the parent of Snapchat. A few names from outside the technology field, like Levi Strauss, the jeans maker, and Chobani, a yogurt company, also signed the brief. Separately, a group of prominent Democrats also protested the ban in a court filing.

The filing is likely to fray already tense relations between Mr. Trump and the technology industry. Its most prominent figures largely backed Mr. Trump’s rival, Hillary Clinton, in last year’s election campaign.

Interactive Feature | Lives Rewritten With the Stroke of a Pen When President Trump signed his executive order on immigration, he upended the fates of people who had waited for years to get into the U.S. Here are portraits of those affected by the ban.

The tech industry’s top executives have faced a balancing act. Challenging Mr. Trump’s policies could invite political blowback, particularly from a president who is unafraid to call out companies publicly. At the same time, they have an outspoken employee base that views Mr. Trump’s economic nationalism as anathema to the globalization that has given rise to many of the companies. Many tech workers are immigrants or from second-generation families, and Silicon Valley itself has a history of immigrants founding and leading some of its most impressive companies.

A number of tech executives initially tried to work with the administration, but a surge in opposition to Mr. Trump’s immigration order led tech workers to call for their executives to push back. Last week Uber’s founder and chief executive, Travis Kalanick, stepped down from Mr. Trump’s economic advisory council after pressure from employees, customers and drivers. Before the decision, Mr. Kalanick had been one of the most vocal proponents of engaging with the president.

The filing is also likely to set off speculation about why some companies did not sign the filing. Prominent technology names that did not sign include Oracle, the big database company; Hewlett-Packard, the computer maker and tech services company; and Tesla, the electric-car company. Company officials could not be reached for comment late Sunday.

Elon Musk of Tesla is on the council that Mr. Kalanick quit. “Activists should be pushing for more moderates to advise President, not fewer. How could having only extremists advise him possibly be good?” Mr. Musk wrote on Twitter on Sunday.

His companies were not signatories to the legal filing. Nor was Palantir Technologies, a company co-founded by Peter Thiel, a prominent technology executive and a staunch supporter of the president. Mr. Thiel’s presence on the board of Facebook has led some employees there to criticize his position.