A federal judge in New York ruled Wednesday that President Trump is in violation of the Constitution when he blocks users on Twitter.

It's a remarkable development in one of the more peculiar debates of Trump's presidency, and a victory for the First Amendment advocates who brought the lawsuit last year.

In her ruling, Judge Naomi Reice Buchwald wrote that "no government official -- including the President -- is above the law, and all government officials are presumed to follow the law as has been declared."

"We hold that portions of the @realDonaldTrump account -- the 'interactive space' where Twitter users may directly engage with the content of the President's tweets -- are properly analyzed under the "'public forum' doctrines set forth by the Supreme Court, that such space is a designated public forum, and that the blocking of the plaintiffs based on their political speech constitutes viewpoint discrimination that violates the First Amendment," Buchwald wrote.

But Buchwald eschewed a decision on providing plaintiffs with relief, saying that her "declaratory judgment should be sufficient."

The Knight Institute, which filed the suit on behalf of several individuals who have been blocked by Trump, applauded the decision.

"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," said Jameel Jaffer, executive director of the Knight Institute. "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 staff attorney at Knight who represented the plaintiffs, said the ruling "should guide all of the public officials who are communicating with their constituents through social media."

The Justice Department defended Trump's Twitter activity, contending that muting is within the president's "associational freedoms." He may be president, the DOJ argued, but Trump still maintains a right to decide who he spends time with on the social media platform.

White House press secretary Sarah Sanders and former White House communications director Hope Hicks, both of whom were named in the suit, were dismissed as defendants.

A Justice Department spokeswoman said "We respectfully disagree with the court's decision and are considering our next steps."

White House spokespeople did not respond to a request for comment regarding the decision and whether the President would now unblock the Twitter users.

The ruling arrives as something of a surprise, given what transpired at a hearing in March. At that time, Judge Buchwald urged both parties to find a resolution outside of court. Her idea for a settlement: perhaps Trump could mute, rather than block, his critics.

"Why are we here?" Buchwald asked at the hearing. "Don't we have a solution that serves the interests of the plaintiffs, serves the interests of the president?"

"It might be better to resolve it in a practical fashion," she added.

After the March hearing, Fallow indicated that she was amenable to Buchwald's proposal.

"As to the muting, I think that is an option," Fallow said at the time. "That is much less restrictive and burdensome on the plaintiffs' speech rights."

But some of the plaintiffs were less enthused by the idea. Outside the Manhattan courthouse in March, Philip Cohen, a sociology professor who was blocked by the president in June of last year, said that muting wouldn't resolve the underlying problem.

"I don't know if muting is really the solution, but if all they really care about, which they say, is that he just doesn't want to hear from us, then he would mute, but obviously he wants to suppress our speech," he said.

--Hadas Gold contributed to this report.