It is a remarkable moment for the technology industry, with many different companies and organizations rallying around a single company — Apple — in a major legal case against the United States government over privacy and security.

Yet behind the scenes, it took time for some of the tech companies to make the decision to support Apple. Several feared the showdown with the government was too risky and could have far-reaching implications for the tech industry if Apple lost.

Those misgivings ultimately did not win the day. About 40 companies and organizations are expected to file court briefs on Thursday backing Apple as it fights a judge’s order to help law enforcement break into an iPhone used by a gunman in the San Bernardino, Calif., terrorist attack last year.

Dropbox, Facebook, Google, Microsoft, Snapchat and Yahoo are among the tech companies expected to sign on to briefs in the case, according to people with knowledge of the plans who spoke on the condition of anonymity. More than 40 individuals, including prominent security experts and academics, are also planning to sign briefs, which will focus on themes like free speech, the importance of encryption and concerns about government overreach.