A federal judge has barred former US President Donald Trump from criticizing prosecutors, the court and possible witnesses ahead of his trial on election subversion charges. It follows recent remarks in which the former president slammed prosecutors as "a team of thugs" and attacked one witness in the case as "a gutless pig". Judge Tanya Chutkan said a limited gag order against Trump was necessary to prevent "a pre-trial smear campaign". A Trump spokesperson criticized the ruling as "another partisan knife". The Republican frontrunner for president in 2024 was charged earlier this year over his alleged efforts to overturn his 2020 election defeat at the hands of Democrat Joe Biden. The four counts in his indictment were: conspiracy to defraud the US, conspiracy to obstruct an official proceeding, obstruction of an official proceeding and conspiracy against the rights of citizens. Special Counsel Jack Smith, who is leading the investigation, requested a gag order on the basis that Trump's comments could "prejudice" participants, including prosecutors, jurors and court staff. His office also argued that attacking potential witnesses would have a "chilling" effect on the case. "The defendant can't be permitted to intentionally try this case in the court of public opinion," government lawyer Molly Gaston argued in court on Monday. That left Judge Chutkan in the tricky position of balancing the need to protect the legal proceedings with the free speech rights of a political candidate. Over the course of more than two hours, she reminded Trump's team that, as a criminal defendant, he "does not have the right to say and do exactly what he pleases". She noted Trump had referred to Smith as "deranged", and to her as "a biased Trump-hating judge" and "a radical Obama hack". She added that she was "deeply disturbed" by his inclination to attack others, such as the special counsel's wife and a court staffer in his New York civil fraud case. Trump faces a partial gag order in that case over his criticism of the New York judge's top clerk in a post that included her name, photograph and social media. "This is not about whether I like the language Trump uses," Judge Chutkan said on Monday. "This is about language that presents a danger to the administration of justice." Attorney John Lauro, who spoke on the former president's behalf, defended his "colorful language" as part of the "rough and tumble" of politics. He argued that Trump was in the middle of a campaign and "entitled to speak truth to oppression". But Judge Chutkan pushed back: "Because he is running for president, he gets to make threats?" Her limited ruling on Monday was "narrowly tailored", she said — not as far as the special counsel wanted, but doing enough to prevent a "smear campaign". The partial order does not block Trump from criticizing President Biden, His Justice Department or Washington, where the case is being tried. But it does bar comments about the special counsel, his team, court staff or potential witnesses — except Mike Pence, Trump's vice-president and rival in the 2024 race. Judge Chutkan did not say how she will enforce her partial order but promised to consider sanctions "as may be necessary" if the restrictions were violated. "One simple solution: Let's have this trial after the election and solve the problem," Lauro had earlier proposed. But the judge reaffirmed that the trial "will not yield to the 2024 election cycle". In a statement, a spokesperson for Trump slammed the ruling as "an absolute abomination and another partisan knife stuck in the heart of our Democracy by Crooked Joe Biden, who was granted the right to muzzle his political opponent". The trial begins on March 4 — the same day as Super Tuesday, a pivotal day of voting in the Republican presidential primary contest. As Trump campaigns once again for the White House, he also faces three other criminal trials next year, and a total of 91 felony charges. — BBC