It offered several theories to back that notion. They included arguments that Mr. Trump was imposing an unconstitutional restriction on the plaintiffs’ ability to participate in a designated public forum, get access to statements the government had otherwise made available to the public and petition the government for “redress of grievances.”

Filed in Federal District Court for the Southern District of New York, the lawsuit also names Sean Spicer, the White House press secretary, and Dan Scavino, Mr. Trump’s director of social media, as defendants. It seeks a declaration that Mr. Trump’s blocking of the plaintiffs was unconstitutional, an injunction requiring him to unblock them and prohibiting him from blocking others for the views they express, and legal fees.

The Knight First Amendment Institute, directed by Jameel Jaffer, also joined the lawsuit as a plaintiff although its Twitter account had not been blocked by Mr. Trump. It argued that it had a First Amendment right to hear from people who had been blocked and are barred from participating in the “forum” of message chains based on his postings.

The lawsuit was foreshadowed last month by a letter the Knight First Amendment Institute sent to Mr. Trump on behalf of two of the now-plaintiffs asking him to unblock their accounts, but the White House did not do so.

News of the letter, and the novel legal arguments it advanced, touched off a debate among legal specialists, with some supporting the idea and others expressing skepticism. The skeptics argued, among other things, that Mr. Trump’s account was personal, not official; that he had the same right to block people he considered trolls as anyone else; and that the injury to blocked people was minor since they could still view his postings as long as they did not log in to Twitter under their own accounts.