Facebook and Twitter are siding with Apple in its fight against a court order demanding the company help investigators break into an iPhone used by one of the San Bernardino attackers.
A US magistrate ordered the firm to produce software that would give investigators access to the phone.
Apple has until Tuesday to challenge the order, setting the stage for a legal clash that experts say could change the relationship between tech companies and governments around the world.
Twitter's chief executive, Jack Dorsey, tweeted that the firm stood with Apple and its CEO, Tim Cook. He also thanked Cook for his leadership, the Associated Press news agency reported.
Facebook in a statement said it condemned terrorism and also appreciated the police. But it said it would "fight aggressively" against requirements for companies to weaken the security of their systems.
"These demands would create a chilling precedent and obstruct companies' efforts to secure their products," the statement said.
Alphabet, which runs the world's largest search engine, Google, has also given Apple its backing.
The government is not asking Apple to help to break the iPhone's encryption directly, but to disable other security measures that prevent attempts to guess the phone's passcode.
Cook argues that once such a tool is available, "the technique could be used over and over again, on any number of devices", even as law enforcement insists that safeguards could be employed to limit its use to that particular phone.
While other tech companies have spoken against broad government surveillance in the past, the Obama administration has sought to enlist the tech industry's help in stopping future attacks.