(NEXSTAR) — A gag order has been imposed against former President Donald Trump by the federal judge overseeing the 2020 election interference case he is facing in Washington, D.C.

The narrow gag order prohibits Trump from making statements that target prosecutors, possible witnesses, and court staff.

Shortly after it was imposed during a Monday hearing in Washington’s federal court, Trump took to social media, vowing to appeal the order. He later called it unconstitutional during a campaign appearance in Iowa and claimed it would only help him in the polls — he’s already the leading Republican candidate for the 2024 election.

Earlier this month, the judge overseeing Trump’s New York fraud trial issued a limited gag order for all parties in the trial after a post to the former president’s Truth Social account targeted the judge’s principal clerk. In that gag order, Judge Arthur Engoron barred Trump and others in the case from posting or speaking publicly about members of his staff.

But what is a gag order — and what could happen if Trump violates it?

Gag orders can be issued by a court (like the order imposed against Trump), government, or private entity, and require a person to refrain from making public comments, Middle Tennessee State University explains. They are often imposed against trial participants to prevent them from discussing materials relevant to the case outside the courtroom.

Some view gag orders as violations of a person’s First Amendment rights, while others consider it helpful in ensuring a fair trial. The Supreme Court previously ruled that a gag order is constitutional if it can protect the right to a fair trial, is as least restrictive as possible, and will be effective, Yale Law School explains.

The Department of Justice asked for a wider gag order to be imposed against Trump but Judge Tanya Chutkan ruled against it. That order would have limited additional speech targeting her and Washington.

Chutkan said she would impose “sanctions as may be necessary” if the gag order is violated, but she wasn’t more specific. She did, however, list options like admonishing Trump in court, financial penalties, home detention, or revocation of his pretrial release, CNN reports.

Ultimately, the court gets to decide what happens if someone violates a gag order. Judges can threaten gag order violators with fines or jail time, but jailing a presidential candidate could prompt serious political blowback and pose logistical hurdles.

Though he spoke out about the gag order Monday, Trump’s comments likely don’t violate the order.

Speaking from the bench, Chutkan said Trump is entitled to criticize the Justice Department generally and assert his belief that the case is politically motivated but can’t mount a “smear campaign” against prosecutors and court personnel.

“No other criminal defendant would be allowed to do so, and I’m not going to allow it in this case,” Chutkan said.

The Associated Press contributed to this report.