Lib Dem leader Jo Swinson has succeeded in her bid to stop an SNP leaflet which accuses her of accepting a £14,000 donation from "a fracking company".
Ms Swinson asked the Court of Session in Edinburgh to stop the Royal Mail from distributing the leaflet in her East Dunbartonshire constituency.
The SNP's QC had argued there was no "substantial untruth" in the leaflet.
But Lord Pentland said a statement on the leaflet was false in substance, materially inaccurate and defamatory.
He said: "I don't consider it would be right for an official election leaflet which contains a prima facie defamatory statement to be distributed by the Royal Mail."
Ruling in favour of Ms Swinson, Lord Pentland ordered the SNP and its candidate Amy Callaghan to pay Ms Swinson's costs.
The SNP's legal team is considering an appeal.
'No substantial untruth'
Ms Swinson's lawyers said the leaflet had accused her of hypocrisy because she had accepted a £14,000 donation "from a fracking company.""
However, lawyers acting for Ms Swinson claimed the statement was defamatory.
They also sought an order from judge Lord Pentland which would stop the Royal Mail from distributing the leaflet.
Roddy Dunlop QC told the court earlier that a director of Warwick Energy, a renewable energy company which holds licences for fracking, had made the £14,000 donation in a personal capacity to Ms Swinson's constituency office.
The QC said the donation had not been made to Ms Swinson personally and had not come from a fracking company, and that 80% of the company's output came from renewable energy sources.
He said: "It does have a fracking licence but it doesn't engage in shale gas fracking."
Mr Dunlop added: "We are in the midst of a general election. It is unlawful for there to be made a false statement of fact in relation to the personal character or conduct of a character."
The leaflets were due to be distributed by the end of this week.
The court heard that a number of them had already been distributed.
For the SNP, Jonathan Mitchell QC said there was no "substantial untruth" in the leaflet. He said the money was from a "fracking source."
He added: "These are allegations, disgraceful allegations, made against her which have been out in the public domain since June.
"The criticism is of her voting record and her connection to frackers.
"There is no substantial falseness in any of this."
The claims contained in the leaflet did not meet the legal test for defamation, he added.
He said the hypocrite remark was justified given Ms Swinson's past public statements in which she said she supported pro-environment government policies.
He added: "The allegation is not one regarding personal conduct or character. It is of her policies.
"The complaint is about her priorities; her record."
Following Lord Pentland's decision, Mr Mitchell said his clients would consider launching an appeal as a matter of "urgency".
He said this was because voters in East Dunbartonshire casting postal votes would do so without receiving an electoral communication from the SNP.