Former Scottish Labour leader Kezia Dugdale has won a legal case brought by a pro-independence blogger who accused her of defamation.
Wings Over Scotland blogger Stuart Campbell took Ms Dugdale to court after she claimed in a newspaper column that he had sent "homophobic tweets".
In a written judgment, Sheriff Nigel Ross said Ms Dugdale was incorrect to imply that Mr Campbell is homophobic.
But he said her article was protected under the principle of fair comment.
As a result, the sheriff ruled that Ms Dugdale was not liable to pay any damages to Mr Campbell, who had been seeking £25,000.
The case centred on a tweet posted by Mr Campbell during the Conservative Party conference in 2017, which said that Conservative MSP Oliver Mundell "is the sort of public speaker that makes you wish his dad had embraced his homosexuality sooner."
In a subsequent column in the Daily Record newspaper, Ms Dugdale referenced his "homophobic tweets" and accused him of spouting "hatred and homophobia towards others" from his Twitter account. She later raised the tweets in the Scottish Parliament, and called on SNP politicians to "shun" Mr Campbell.
Oliver Mundell is the sort of public speaker that makes you wish his dad had embraced his homosexuality sooner.— Wings Over Scotland (@WingsScotland) March 3, 2017
Mr Campbell, from Bath in Somerset, strongly denied his tweet was a homophobic reference to David Mundell being gay, and insisted it was "satirical criticism" of Oliver Mundell's public speaking skills.
A three-day hearing took place at Edinburgh Sheriff Court last month, during which Mr Campbell described himself as a "firm advocate of equal rights for gay people" and said it was "absurd" to describe his tweet as homophobic.
In his judgement, Sheriff Ross agreed that Mr Campbell "does not hold homophobic beliefs or feelings" and had "demonstrated by his conduct over many years that he supports equality for homosexual people".
The sheriff also said Mr Campbell's tweet about Mr Mundell "was not motivated by homophobia and did not contain homophobic comments", and that Ms Dugdale had therefore been "incorrect" to describe it as homophobic.
But the sheriff said: "Ms Dugdale's article contained the necessary elements for a defence of fair comment. It was based on true facts; the statements complained about were honest; it concerned a matter of public interest, and the comments were fair.
"Her comments were fair, even though incorrect".
Sheriff Ross added that the defamation laws recognise there is "significant public interest in allowing people to freely express opinions without fear of legal penalty".
He went on to describe Mr Campbell as someone who has "chosen insult and condemnation as his style", and said the blogger cannot "hold others to a higher standard of respect than he is willing himself to adopt.
"I do not accept that he can dismiss the feelings or reputations of his opponents cheaply, but receive a high valuation of his own.
"Had I been awarding damages, those damages would have been assessed at £100".
We've received the sheriff's decision on the Kezia Dugdale court case. Short version: I'm not a homophobe, she did defame me, but she gets away with it. https://t.co/2bIRY5kpRk— Wings Over Scotland (@WingsScotland) April 17, 2019
Responding to the ruling, Ms Dugdale said she was "delighted and hugely relieved" to have won the case, and described it as an "important judgement for the right to free speech and a healthy press."
The Labour MSP added: "This ruling clearly demonstrates that every citizen is entitled to make comments as long as they are fair and reflect honestly held views".
Speaking to BBC Scotland, Mr Campbell said: "It is completely perplexing that the sheriff could find that Kezia Dugdale's remarks were defamatory yet that she was not guilty of defamation."
He called on Ms Dugdale to apologise to him, and said he was taking legal advice on whether or not to appeal against the ruling.
In a written statement, he added: "I sought to defend my reputation against a false accusation of homophobia, to establish that I'm not a homophobe, and to prevent anyone from being able to make such claims in future.
"All of those aims have been upheld, in explicit terms, by this judgement."