A councillor is to pay £3,000 and costs to a political rival for posting a libellous comment on Twitter.
Caerphilly county councillor Colin Elsbury had claimed that Eddie Talbot had been removed from a polling station by police during a by-election in 2009.
Town councillor Mr Talbot said the untrue claim left him open to ridicule.
Mr Elsbury agreed to pay compensation and legal costs and to publish an apology via Twitter, the High Court in Cardiff heard.
Mr Talbot was a Caerphilly town councillor seeking election to the county council as an independent in the by-election held in Caerphilly's St Martin's ward in June 2009.
Mr Elsbury, the Plaid Cymru candidate and eventual winner, wrote on his Twitter page on the day of the poll: "It's not in our nature to deride our opponents however Eddie Talbot had to be removed by the Police from a polling station."
Mr Talbot's solicitor Nigel Jones told the court that the implication of the Twitter statement was that his client had been forcibly removed for criminal or disreputable conduct, adding that the allegation was completely untrue and defamatory.
The man targeted by the tweet - who came second in the closely-fought six way by-election - says the statement left him open to ridicule.
The High Court heard that Mr Elsbury had agreed to pay Mr Talbot £3,000 in compensation, to publish an apology on his Twitter site, and pay legal costs, understood to be substantial.
After the case, Mr Talbot said he had suffered anger, upset and ridicule over the comment.
Mr Jones said it sent a message out to people to be careful what they said on social network sites, as it could prove "expensive".
Mr Elsbury, who was unable to attend the hearing because his wife is in hospital, said: "This was a genuine case of mistaken identity which I have acknowledged."
He said he had agreed to pay compensation and had offered to settle by making a substantial donation to charity or a good cause but this was not accepted.
"The issue of costs will now be the subject of independent adjudication," he said.
"This case will no doubt act as a warning to people, including politicians, to be extremely careful when using Twitter and other social media such as blogs."