"No government official — including the President — is above the law," wrote Buchwald for the U.S. District Court for the Southern District of New York.
Under the ruling, Buchwald did not order Trump to unblock his followers, saying that clarification of the law is sufficient to resolve the dispute. Should Trump ignore the ruling, analysts say, future litigation could force Twitter to unblock Trump's followers unilaterally.
The decision marks a victory for free-speech activists representing seven Twitter users who alleged that their rights had been infringed after they tweeted at Trump critiquing his policies. Trump blocked them on Twitter, preventing them from seeing his tweets from their account or interacting with them.
"We are extremely pleased that the judge held that the president’s blocking of critics from the @realDonaldTrump Twitter account violates the First Amendment,” Katie Fallow, a senior staff attorney with the Knight First Amendment Institute who argued the case, said.
While the ruling narrowly targets the Trump administration and is not binding on other public officials, it establishes an important legal precedent that they will be likely to follow. Importantly, the ruling identifies only parts of Trump's account as a public forum subject to First Amendment protections, not the entire account nor the rest of Twitter.
"The decision may have implications for other government officials' blocking of critics on social media," said Joshua Geltzer, an expert in constitutional law at Georgetown University, "but it doesn't even come close to making all of Twitter a public forum, as the vast majority of the Twittersphere is not being converted into a public forum by government actors."
The government does not dispute that Trump blocked the Twitter users for political reasons. But the Justice Department had argued Trump was largely acting in a personal capacity, much like "giving a toast at a wedding or giving a speech at a fundraiser."
But through his Twitter bio and the way in which he frequently uses the medium to comment on public policy, Trump portrays his account as presidential "and, more importantly, uses the account to take actions that can be taken only by the President as President," Buchwald wrote.
What's more, Buchwald said, the space below Trump's tweets that show the public's replies are a public forum, because it is "generally accessible to the public" and anyone with a Twitter account is able to view those responses, assuming that the user has not been blocked.
While presidents retain their own First Amendment rights even when they take public office, the judge said, Trump "cannot exercise those rights in a way that infringes the corresponding First Amendment rights of those who have criticized him."
Noah Feldman, a Harvard law professor, said he thinks the case was wrongly decided and expects it to be reversed. For a public forum to exist, the government has to own or control it, he said, but in this case, Twitter also controls Trump's account.
Twitter has long been dogged by questions about how far its users’ right to speech may extend. In the past, its own executives have described the company as being “the free speech wing of the free speech party,” holding that Twitter takes no position on the messages posted by its users.
But the rise of online bullying, hate speech and harassment on Twitter’s platform has forced the company to confront its insistence on neutrality. Last year, the company unveiled new policies to address threats of violence or reports of abuse. And it has barred some controversial right-wing figures, such as the writer Milo Yiannopolous, from the platform for violating its policies.
Wednesday's ruling could complicate that debate, said Feldman, potentially giving people such as Yiannopolous grounds to sue Twitter and demand that they be permitted back on Twitter to view Trump's account and to participate in the public forum surrounding it.
"That is crazy," he said. "But it is a possible logical outcome of this decision."
The White House did not immediately respond to a request for comment. Twitter declined to comment.