Prosecutors have asked the judge overseeing former President Donald J. Trump’s federal indictment on charges of conspiring to overturn the 2020 election to impose “a narrowly tailored” gag order on him, citing his “near-daily” social media attacks on people involved in the case, according to court papers released on Friday.

The request to Judge Tanya S. Chutkan of Federal District Court in Washington, who has herself been the subject of some of Mr. Trump’s verbal assaults, brought to a head the simmering issue of the former president’s online statements.

In a 19-page motion, prosecutors said that some of the people Mr. Trump has gone after on social media — including the special counsel, Jack Smith, who has filed two indictments against him — have experienced subsequent threats from others. Mr. Trump’s statements, they said, could also affect witnesses and the potential jury pool for the trial, which is scheduled to take place in Washington starting in March.

“Since the indictment in this case, the defendant has spread disparaging and inflammatory public posts on Truth Social on a near-daily basis regarding the citizens of the District of Columbia, the court, prosecutors and prospective witnesses,” federal prosecutors wrote.

“Like his previous public disinformation campaign regarding the 2020 presidential election,” they wrote, “the defendant’s recent extrajudicial statements are intended to undermine public confidence in an institution — the judicial system — and to undermine confidence in and intimidate individuals — the court, the jury pool, witnesses and prosecutors.”

The gag order sought by the government would prevent Mr. Trump from making any statements about the identity or testimony of witnesses in the case or any remarks about anyone involved in the proceeding that could be considered “disparaging and inflammatory, or intimidating.”

“The government seeks a narrow, well-defined restriction that is targeted at extrajudicial statements that present a serious and substantial danger of materially prejudicing this case,” prosecutors wrote.

Regardless of the outcome of the request, the legal battle over a gag order on the famously outspoken Mr. Trump will no doubt lead to scorched-earth arguments about his First Amendments rights — a defense his lawyers have already sought to raise.

The fight will be all the more intense given Mr. Trump’s status as the front-runner for the Republican presidential nomination and his intention to make the prosecutions a central issue in his campaign.

John F. Lauro, a lawyer representing Mr. Trump in the election interference case, declined to comment on the government’s request. A spokesman for Mr. Trump said that the Justice Department was “corruptly and cynically continuing to attempt to deprive President Trump of his First Amendment rights.”

Within a few hours of the government’s request for a gag order, Mr. Trump attacked Mr. Smith both on social media and in a speech as “deranged,” as he has done several times before.

“They Leak, Lie, & Sue, & they won’t allow me to SPEAK?” Mr. Trump wrote in a post on Truth Social.

And to raucous applause at a dinner Friday night in Washington for the conservative group Concerned Women for America, he added: “These people are sick. They want to silence me because I will never let them silence you.”

Almost from the moment he entered public life, Mr. Trump has reflexively attacked his enemies in vivid and often vicious fashion, making use of social media in particular. But now that he is a defendant, facing four indictments in four different cities, his habit of threatening and bullying those in his way has bumped up against the traditional strictures of the criminal justice system.

The request by prosecutors for a gag order was initially made in a sealed filing to protect the identities of the people who had been threatened. Mr. Smith’s team filed a public version of their request on Friday with limited redactions.

The issue of Mr. Trump’s threatening statements began almost immediately after he was indicted last month on three overlapping conspiracies to defraud the United States, to disrupt the certification of his loss to Joseph R. Biden Jr. and to deprive people of the right to have their votes counted.

One day after he was arraigned, Mr. Trump posted a message on his social media platform, Truth Social, saying, “If you go after me, I’m coming after you.” Mr. Trump’s campaign quickly said the statement referred to the former president’s political adversaries.

Still, the government complained about the post and one week later, at a hearing in Washington, Judge Chutkan sent a shot across Mr. Trump’s bow, telling his lawyers that she would not tolerate any remarks from the former president that might “intimidate witnesses or prejudice potential jurors.”

“I caution you and your client to take special care in your public statements in this case,” Judge Chutkan said. “I will take whatever measures are necessary to protect the integrity of these proceedings.”

But within days, Mr. Trump tested that warning by posting a string of messages on Truth Social that largely amplified others criticizing Judge Chutkan.

In their filing on Friday, prosecutors went through a long litany of Mr. Trump’s social media attacks, noting how he has referred to Mr. Smith several times as “deranged” and to the prosecutors working under him as a “team of thugs.” They pointed out that Mr. Trump has called Judge Chutkan “a radical Obama hack” and a “biased, Trump-hating judge.”

Prosecutors also said that Mr. Trump has attacked the residents of Washington who one day will be called upon to serve as the jury pool for his trial. In one post, Mr. Trump claimed that he would never get a fair hearing from those who lived in the “filthy and crime ridden” district, which he said “is over 95% anti-Trump.”

The filing described how Mr. Trump had attacked a prosecutor in the other case that Mr. Smith is handling — one in which the former president stands accused of illegally holding on to dozens of classified documents after leaving office and then conspiring with two of his aides to obstruct the government’s attempts to get them back.

In late August, Mr. Trump, apparently referring to an article in The New York Post, attacked the prosecutor in the documents case, Jay I. Bratt, for having met at the White House with officials of the Biden administration. But prosecutors said that, as Mr. Trump knew from the discovery evidence he had received in the case, Mr. Bratt went to the White House as part of the investigation of the classified documents case to interview a “career military official” who worked there.

Seeking to connect Mr. Trump’s out-of-court statements directly to the charges they have brought, prosecutors cited several social media attacks that reached back to the chaotic postelection period when Mr. Trump was spreading lies that widespread fraud had marred the vote count. The prosecutors accused Mr. Trump of knowing that his menacing remarks at that time often inspired “others to perpetrate threats and harassment against his targets.”

As an example, they cited Chris Krebs, the former head of the government’s cybersecurity agency, whom Mr. Trump had fired and then attacked on Twitter after Mr. Krebs vouched for the integrity of the 2020 election.

Not long after those attacks, prosecutors noted, one of Mr. Trump’s lawyers went on the conservative TV outlet Newsmax and declared that Mr. Krebs “should be drawn and quartered,” and “taken out at dawn and shot.”

The government’s filing also mentioned Ruby Freeman and Shaye Moss, two Georgia election workers, whom Mr. Trump and his allies falsely accused of having mishandled ballots while counting votes in Atlanta during the 2020 election.

After Mr. Trump “spread false accusations” against Ms. Freeman and Ms. Moss — who are mother and daughter — they were “inundated” by “pernicious threats and intimidation,” prosecutors said.

Charlie Savage, Glenn Thrush and Chris Cameron reporting.