A Trump administration requirement that all visa applicants turn their social media information over to federal agencies will chill free speech online and be especially dangerous for journalists traveling to the U.S. from countries with repressive governments, two rights groups argued in federal court on Thursday.

Representing documentary filmmakers from all over the world, the Knight First Amendment Institute and Brennan Center for Justice filed a complaint against the rule, which went into effect in May.

The rule "stifles speech on the largest platforms for public discourse—including this one," wrote Carrie DeCell, an attorney for the Knight Institute, on Twitter.

Requiring visa applicants to register their social media handles with the U.S. government stifles speech on the largest platforms for public discourse—including this one. 1/x https://t.co/8AnKYXkhfZ — Carrie DeCell (@cmd_dc) December 5, 2019

The Knight Institute and Brennan Center are representing the Doc Society and the International Documentary Association (IDA), which count hundreds of filmmakers from all over the world as their members, many of whom make political films.

Filmmakers are among nearly 15 million visa applicants per year who are now required to turn over handles they've used for the preceding five years on 20 different social media platforms. The State Department and Department of Homeland Security (DHS) can retain the information indefinitely and in some cases share the applicants' social media accounts with foreign governments, including those of their home countries.

The Doc Society and IDA surveyed more than 100 of their international members and found that many were "concerned that their political views will be used against them during the visa process."

The requirement could be particularly dangerous for filmmakers coming to the U.S. from repressive regimes which do not observe free speech rights, the groups said. For journalists in such countries, maintaining anonymity online "can be a matter of life and death," said Jess Search, director of Doc Society, in a statement.

"As an organization committed to filmmaker safety, we believe the registration requirement is a deeply troubling and oppressive development, forcing filmmakers to choose between free online expression and their own security," said Search. "The U.S. government should be championing freedom of expression, not taking actions which will inhibit it."

The groups' members reported that with the requirement in effect, they were likely to reconsider traveling to the U.S., try to scrub their social media accounts of posts, or avoid sharing their views online.

Last July, I traveled abroad to renew my US visa and was forced to turn over my social media handles. I spent the night before my consular interview sweating because of my Twitter feed. Thrilled my colleagues at @knightcolumbia filed this lawsuit. https://t.co/9Q20yvYUN7 — Ramya Krishnan (@2ramyakrishnan) December 5, 2019

Ramya Krishnan, an attorney with the Knight Institute, shared on Twitter the anguish the rule had caused her when she applied to renew her visa earlier this year.

Last July, I traveled abroad to renew my US visa and was forced to turn over my social media handles. I spent the night before my consular interview sweating because of my Twitter feed. Thrilled my colleagues at @knightcolumbia filed this lawsuit. https://t.co/9Q20yvYUN7 — Ramya Krishnan (@2ramyakrishnan) December 5, 2019

Oliver Rivers, managing director of Doc Society, called the rule "bureaucratic intervention in freedom of speech."

"It's not just a small requirement on a visa form," Rivers told The Intercept. "It's very, very clear encroaching bureaucratic oppression, and I think you have to make a stand when you see something like this."

While the lawsuit focuses on the rule's effects on journalists, the requirement has already led to the temporary deportation of a Palestinian Harvard student who was denied entry to the the U.S. because of his Facebook friends' social media posts.

Jameel Jaffer, executive director of the Knight Institute, called the requirement a clear violation of the First Amendment.

"The government simply has no legitimate interest in collecting this kind of sensitive information on this immense scale, and the First Amendment doesn't permit it to do so," said Jaffer.