ONE of the two election court judges deciding the fate of former LibDem Scottish Secretary Alistair Carmichael was previously an "active member" of the SNP.

Lord Hugh Matthews was an SNP branch convenor and constituency treasurer, and spoke a number of times at the party’s national conference.

He also spoke “from time to time” with Nicola Sturgeon, provided legal advice to the SNP on several occasions, and once appeared for the party at the Court of Session.

Lord Matthews disclosed his SNP links in advance of Scotland’s first election court for 50 years in a so-called ‘Hoffmann declaration’, a copy of which has been obtained by the Herald.

Although much of the activity took place in the early 1990s, when Lord Matthews was an advocate, he said his conversations with Ms Sturgeon were more recent, with the last around 2005.

One senior Labour source said Lord Matthews’s role in the Carmichael case was now “the talk of the steamie” at Westminster because of his Nationalist connections.

SNP sources said Lord Matthews, 61, had been active in his home town of Kilmarnock.

Four of Mr Carmichael’s constituents are trying to overturn his election as MP for Orkney & Shetland on the basis he lied about leaking a Scotland Office memo about the First Minister.

Lord Matthews and Lady Paton heard evidence from the MP during a three-day hearing earlier this month, and are now considering their judgment.

If they find Mr Carmichael broke electoral law, there could be a byelection and Mr Carmichael’s political career would be in tatters.

The SNP, who came second in May by 817 votes, would be clear favourites to win the seat.

An SNP gain would leave the LibDems with no MPs in Scotland and just seven in the UK.

Lord Matthews revealed his SNP activity to both sides in the case via email on July 22, two weeks after he replaced Lord Eassie on the election court rota.

Sent by a clerk, the email said "Lord Matthews has today instructed me to advise parties of his previous involvement with the SNP", then listed his activities.

His involvement in politics "necessarily came to an end" only when he was first appointed to the bench, as a sheriff in Glasgow, in 1997.

It ended: “Could parties please confirm, as soon as possible, that there are no objections to his Lordship sitting on 7 and 8 September?”

Neither side subsequently applied for him to step aside or “recuse” himself from the election court.

The Lord President’s office said that, because the parties had waived any objection to him hearing the case, “and having regard to his judicial oath, Lord Matthews concluded that he should hear the case”.

The Scotland Office memo at the heart of the Carmichael case was leaked to the Daily Telegraph in April in order to damage the SNP in the general election.

It wrongly claimed Ms Sturgeon wanted David Cameron to stay in power and did not consider Ed Miliband Prime Ministerial material.

Mr Carmichael denied knowing about the leak, but a Cabinet Office inquiry reported later confirmed that he and his special adviser, Euan Roddin, were the culprits.

Judges are required to cease party membership when appointed.

A spokeswoman for the Judicial Office for Scotland said: “Many judges will have been involved in politics before taking up judicial office.

“Lord Matthews declared his previous involvement to both parties prior to the commencement of proceedings.

“Following this declaration, no motion for Lord Matthews to decline jurisdiction (recuse himself) was made.”

A LibDem spokesman said the party had "absolute confidence in the neutrality of Lord Matthews".