NEW YORK — Judges taking up a case over President Trump’s Twitter habits ran through a quick list Tuesday of some recent tweets:

The announcement of the president’s new pick for the Federal Reserve’s board of governors, views on North Korea sanctions and a congratulatory welcome to the White House of the Stanley Cup-winning Washington Capitals ice hockey team.

How, the judges asked, could the president’s social media messages not amount to official government business, including when he closes off his social media to critics?

“Are you seriously urging us to believe the president isn’t acting in his official capacity when he’s tweeting?” asked Judge Barrington D. Parker Jr. of the U.S. Court of Appeals for the 2nd Circuit.

The appeals court is considering the novel question of whether the First Amendment prevents Trump — and other elected officials — from shutting off critics on a platform the president regularly uses to communicate with the public.

The Trump administration is appealing a district court judge’s ruling from May siding with seven people blocked on the @realDonaldTrump account after they posted disapproving comments of the president and his policies.

Trump’s decision to block individual followers from replying and retweeting his messages, Parker said Tuesday in court, “subtracts from that discussion points of view the president doesn’t like.”

“Why isn’t that a quintessential First Amendment violation?” the judge asked.

Justice Department lawyer Jennifer Utrecht in her reply acknowledged the president’s tweets are official government statements, but she said Trump is acting in his private, unofficial capacity when he decides to block followers from his personal account.

“You are here because he’s not a private individual,” Judge Peter W. Hall responded, noting that the president was being represented by the Justice Department and not a private attorney.

The Supreme Court has not directly addressed how the law applies to expanding digital spaces for public debate, and the case involving the president’s account is a high-profile legal test that has affected how elected officials around the country interact online with constituents.

The First Amendment prevents the government from blocking or excluding views it disagrees with in what is known as “viewpoint discrimination.” Elected officials throughout the country are learning to navigate how those principles apply after the earlier decision over the Trump account and one dealing with a Virginia politician.

Justice Department lawyers have said in filings that the ­@realDonaldTrump account is Trump’s personal platform to share his views, not an extension of the federal government. The president, they say, can choose to silence followers “he does not wish to hear” without violating the First Amendment.

In the decision under appeal by the administration, U.S. District Judge Naomi Buchwald of New York said the comment threads attached to Trump’s tweets are an unrestricted public forum and that it is unconstitutional to block people from those interactive spaces because of their views.

In response to the lower court’s ruling, the president unblocked the seven followers and then appealed.

Sitting in the front row of the 17th-floor, wood-paneled courtroom Tuesday were three of them: Philip N. Cohen, a professor; Nicholas Pappas, a comedy writer; and Eugene Gu, who works for a medical start-up company.

Free-speech advocates say the online comment section of an elected official’s social media site is no different from a traditional town hall meeting. Those spaces, they say, are subject to First Amendment protections that allow citizens to respond directly to their government officials and engage with others about public policies.

Jameel Jaffer, executive director of the Knight Institute at Columbia University which is representing the followers who had been blocked, told the court that the president can’t have it both ways. If Trump’s tweets are official government statements, then the comment threads cannot be closed off to critical voices. The individuals barred from the president’s feed had taken issue with Trump’s policies related to immigration, health care and Russia.

“They were blocked for having criticized the president for his decisions as president,” Jaffer said in court.

Judge Christopher F. Droney suggested at the hearing that the president’s personal Twitter account operated by a private company was akin to the government leasing a privately owned auditorium to host an open town hall meeting, where free speech protections for dissenters would still apply.

“How is that different from the blocking here?” Droney asked.

The three-judge panel hearing the case includes Parker and Hall, both nominees of President George W. Bush, and Droney, who was nominated by President Barack Obama.

Lawyers for the blocked individuals say the case is not about Twitter, a private company, but about how Trump uses Twitter as president. He routinely takes to Twitter to announce government appointments and dismissals and his administration’s policies. Then-press secretary Sean Spicer told reporters in June 2017 that Trump’s tweets should be considered “official statements by the president.” The National Archives has said Trump’s tweets must be preserved as presidential records.

The Justice Department in court filings drew parallels between the president’s personal Twitter account and the physical properties he owned before taking office. Just as the Bushes have Kennebunkport and the Kennedys have Hyannis Port, a president’s residence — or social media account — does not become government property when the president issues public statements or conducts government business there, Justice Department lawyers contend.

In January, the Richmond-based U.S. Court of Appeals for the 4th Circuit became the first appeals court to consider the similar question of whether free-speech protections prevent public officials from barring critics from their social media feeds. The court unanimously held that a Virginia official could not block critical comments from a constituent on the Facebook page she uses to conduct government business.

The 4th Circuit said the official’s page had “ ‘the power and prestige of h[er] state office’ ” and that she had made and used the page to conduct “actual or apparent dut[ies] of h[er] office.” Banning the critical commenter, the court said, amounted to “an effort ‘to suppress speech critical of [such members’] conduct of [their] official duties or fitness for public office’ further reinforces that the ban was taken under color of state law.”