Donald Trump has been fined $5,000 (£4,100) for failing to delete an “untrue and disparaging” claim online about a court clerk in his New York civil fraud case.
The former US president had earlier been threatened with jail over the post.
Judge Arthur Engoron issued the penalty after previously warning Trump he could be imprisoned for breaking a gagging order which banned those involved in the case from making public comments about members of his staff.
The court is currently hearing a civil case over accusations that Trump committed fraud for years while building his property portfolio by inflating his assets and net worth in return for favourable bank loans, as well as lower insurance premiums.
Prosecutors are seeking at least $250m (£205m) in fines and a permanent ban against Trump and his sons Donald Jr and Eric from running businesses in New York.
The gagging order was issued earlier this month after Donald Trump published a post on his social network site Truth Social about the woman, in which he suggested she had a personal relationship with Democrat Senate majority leader Chuck Schumer.
Judge Engoron issued the order and demanded Trump delete the “untrue, disparaging and personally identifying post” from Truth Social, which he did within 10 minutes, according to court documents.
However, it emerged on Friday that it remained visible on the Republican’s official 2024 presidential campaign website for a further 17 days.
Trump’s legal team apologised and said it had been an “inadvertent” mistake that no-one on his team had deleted it.
But Judge Engoron warned that “in the current overheated climate, incendiary untruths can, and in some cases already have, led to serious physical warm, and worse”.
In a written ruling, he said he was “way beyond the ‘warning’ stage”, but decided on a nominal fine because the violation of the gagging order had been unintentional and was a “first-time violation”.
However, he added: “Make no mistake: future violations, whether intentional or unintentional, will subject the violator to far more severe sanctions, which may include steeper financial penalties, holding Donald Trump in contempt of court, and possibly imprisoning him.”
Trump denies wrongdoing in the fraud case and has described the trial as “rigged”. He has also claimed it was brought to court by a “radical lunatic” prosecutor.
Judge Engoron has already ruled that Trump and his company committed fraud, but the trial has continued to decide on remaining accusations of conspiracy, insurance fraud and falsifying business records.