The politician instructed lawyers to go to the Court of Session after learning of an election communication which is being distributed in her East Dunbartonshire constituency.
In the leaflet, Ms Swinson’s nationalist rival Amy Callaghan claims the Lib Dem politician is a hypocrite because she accepted a £14,000 donation from a “fracking company”.
However, lawyers acting for Ms Swinson claimed the statement is defamatory. They also sought an order from judge Lord Pentland which would stop the Royal Mail from distributing the leaflet.
However, shortly after 6.30pm, Lord Pentland ruled in favour of Ms Swinson’s bid.
He said that Ms Swinson’s lawyers had shown they had a case to show the statement was potentially defamatory.
He added: “The statement of which the petitioner claims of is on the information which has been put before the court this evening false in substance and materially inaccurate.
“In my view the petitioner has shown she has a prima facie case that the statement is defamatory.”
Lawyers for the SNP were notified of the legal action shortly before 4pm on Tuesday afternoon.
Ms Swinson launched the legal bid after learning of the leaflet’s contents.
The leaflets were due to be distributed by the end of this week - just before the deadline for postal votes to be cast.
The court heard that a number of them had already been distributed.
The court heard how the leaflet stated that Ms Swinson was a “hypocrite” because she received money from Warwick Energy - the statement claimed Warwick was a “fracking company”.
However, Mr Dunlop said the statements were incorrect.
He said that the £14,000 donation was made in a personal capacity by Mark Petterson, a director of the company.
He said Mr Petterson made the donation in a personal capacity and Ms Swinson’s constituency office received the cash.
Mr Dunlop said that even although Warwick held licences for fracking, it did not participate in the controversial gas extraction activity.
The QC added that 80 per cent of the company’s output came from renewable energy sources.
Mr Dunlop said the claims contained in the leaflet were incorrect.
He 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.
“Mr Petterson made the donation in a personal capacity. It is not correct to say that the company is a fracking company - it holds licences for fracking but it is not engaged in it. Most of its activities come from renewable sources.
“Ms Swinson also did not receive the money. It was her constituency office.
“Given that, the statement that she is a hypocrite is not only inaccurate - it is defamatory at common law.”
Ms Callaghan and the SNP’s lawyer Jonathan Mitchell QC called on Lord Pentland to reject Ms Swinson’s bid.
He said that knowledge of the donations had been in the public domain for several months.
Mr Mitchell said that Ms Swinson recorded the donations in her Parliamentary Register of Interests.
Mr Mitchell said the claims contained in the leaflet did not meet the legal test for defamation.
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.
Lord Pentland ordered the SNP pay Ms Swinson’s costs.