President Donald Trump cannot block users on his Twitter feed, a New York federal judge ruled Wednesday.

The judge, Naomi Reice Buchwald, ruled that Trump is violating the U.S. Constitution by preventing Americans from viewing his tweets.

The suit was filed in July 2017 by the Knight First Amendment Institute at Columbia University.

"This case requires us to consider whether a public official may, consistent with the First Amendment, 'block' a person from his Twitter account in response to the political views that person has expressed, and whether the analysis differs because that public official is the President of the United States," the judge said in her opinion. "The answer to both questions is no."

The White House did not immediately respond to CNBC's request for comment.

The institute's executive director, Jameel Jaffer, said in a statement following the ruling: "We're pleased with the court's decision, which reflects a careful application of core First Amendment principles to government censorship on a new communications platform,"

Jaffer added: "The President's practice of blocking critics on Twitter is pernicious and unconstitutional, and we hope this ruling will bring it to an end."

Katie Fallow, a senior staff attorney at the institute, said, "The First Amendment prohibits government officials from suppressing speech on the basis of viewpoint ... The court's application of that principle here should guide all of the public officials who are communicating with their constituents through social media."

Read the full order below: