SCOTLAND’S highest civil court has rejected a UK Government bid to throw out a legal action aimed at ensuring Boris Johnson complies with the law.

The Court of Session refused to dismiss an ongoing legal effort to make sure the Prime Minister sticks to his obligations under the so-called Benn Act.

Scotland's most senior judge, Lord Carloway, said the case should remain before the court “until it is clear that the obligations under [the Benn Act] have been complied with in full”.

Elaine Motion, chair of the law firm Balfour+Manson, which is acting for campaigners, said the Sword of Damocles remains hanging over Mr Johnson’s head.

READ MORE: Scottish and Welsh First Ministers press EU for Brexit delay 

She said: “From our perspective it was a great success again for us, because the court has kept hold of this case, kept it live, to make sure that the Prime Minister continues to comply with the Benn Act and all of the obligations under it.”

The Herald: Elaine Motion from Balfour Manson addresses the mediaElaine Motion from Balfour Manson addresses the media

Legislation passed by MPs last month – known as the Benn Act – compelled the Prime Minister to ask for another Brexit delay if no agreement had been reached with Brussels by October 19.

Mr Johnstone sent an unsigned letter to the EU requesting an extension over the weekend, but also sent a second, signed letter insisting a delay would be a mistake.

Earlier this month, a legal action brought by businessman Dale Vince, QC Jo Maugham and SNP MP Joanna Cherry to make sure Mr Johnson complied with the Benn Act was postponed until after the October 19 deadline.

It resumed at the Court of Session on Monday, where David Johnston QC, representing the UK Government, attempted to have the case dismissed on the grounds that the letter requesting an extension had now been sent.

However, Aidan O’Neill QC, representing the petitioners, argued the language in Mr Johnson’s second letter came close to breaching the Prime Minister’s duty not to frustrate the purpose of the Benn Act.

READ MORE: Scottish Conservatives confirm they will back Boris Johnson's Brexit deal 

He accepted Mr Johnson had complied with the law by sending the letter, but called on the court to continue the case until a future date to ensure the Prime Minister carries out all his obligations under the Benn Act. These include agreeing to a Brexit extension if one is offered.

He added: "We don't know when the EU will come back with a response for the request.

"So it depends on it coming back and ensuring the Prime Minister carried out the duties imposed upon him within the Benn Act."

Speaking outside the Court of Session, Ms Motion said the court’s decision to continue the case was a “real victory” for her clients.

She added: “They have managed to ensure that the letter has been sent, which is a great victory, and this has been continued.

“So the Sword of Damocles remains hanging.”

She continued: “The sword drops if [Mr johnson] frustrates the Act or breaches the Benn Act in any way.

“The sword is released if we have reached the stage where we think the Benn process has ended, and we can come back to court and address the court at that time.”

She said Mr Johnson could face anything from a “slap on the wrist” to a jail sentence if he is found guilty of contempt of court.

Ms Cherry also welcomed the decision, insisting it "keeps the Sword of Damocles hanging over Boris make sure he fully complies with the law and the cross-party Benn Act".

She added: “Despite his childlike antics over the weekend, Boris Johnson was forced to send a letter to the EU to seek an extension to the Brexit deadline - that is now being considered seriously by our EU partners.

"This is a victory for those of us who have been campaigning tirelessly to make sure he follows the law.

“Boris Johnson gave an undertaking to the court that he would not frustrate the purpose of the Benn Act and I am delighted the Court of Session will continue to keep a watchful eye on him despite his schemes."

During the case's first hearing on October 9, the Government's lawyers assured the court Mr Johnson would adhere to the law – despite the Prime Minister publicly stressing he would rather be dead in a ditch than ask the EU for an extension.

European Commission president Donald Tusk confirmed at 10pm on Saturday that he had received the Prime Minister's request, tweeting: "The extension request has just arrived. I will now start consulting EU leaders on how to react."

In his signed letter, Mr Johnson wrote: "A further extension would damage the interests of the UK and our EU partners, and the relationship between us."

The letter, to Mr Tusk and copied to European Council president Jean-Claude Juncker, refers to his regret at being defeated over the Letwin amendment in the House of Commons on Saturday.

It states: "Regrettably, Parliament missed the opportunity to inject momentum into the ratification process for the new Withdrawal Agreement."

MPs voted by 322 to 306 in favour of amending the Brexit deal to withhold the Commons' approval until the necessary UK legislation to leave the EU has been passed.

The Government's response was to cancel Saturday's vote on the deal, with it expected to be brought back before MPs this week.