A legal action to establish whether the UK can unilaterally stop Brexit has been referred to the European court of justice by the court of session in Edinburgh.

The case was brought by a cross-party group of six Scottish MPs, MEPs and MSPs, who want the ECJ to offer a definitive ruling on whether the UK can halt the article 50 process without needing the approval of all other 27 EU member states.

Rejecting the argument put forward by lawyers for the UK government, that ministers have repeatedly made it clear they have no intention of stopping the Brexit process, even if there were no deal with the EU, Scotland’s most senior judge, Lord Carloway, said: “It seems neither academic nor premature to ask whether it is legally competent to revoke the notification and thus to remain in the EU.”

Carloway, one of three judges to consider the case on appeal after it was initially rejected in June as “academic and hypothetical”, noted that the Commons would be required to vote on whether to ratify any Brexit deal before 29 March 2019, “a date which is looming up”, and that a judgment from the ECJ would “have the effect of clarifying the options open to MPs in the lead-up to what is now an inevitable vote”.

Lord Menzies said: “There will have to be a vote, and it appears to me to be legitimate for those who are involved in that vote to know, by means of a judicial ruling, the proper legal meaning of article 50, and in particular whether a member state which has given notification of its intention to withdraw from the EU may revoke that notification of intention unilaterally before the expiry of two years after the notification.”

Article 50 is silent on whether the member state that has triggered it unilaterally can also cancel it unilaterally. UK ministers and the European commission have indicated they believe that withdrawing an article 50 application requires the consent of the 27 other EU member states.

Jolyon Maugham QC, the director of the Good Law Project, who helped arrange the case after a crowdfunding appeal, said the ruling showed it was “not too late to wake up from the nightmare that is this government’s Brexit. Today is a vital step in proving we can remain within the European Union with all of our opt-outs and rebates.”

The Scottish Green party MSP Andy Wightman, who led the group of politicians, said: “I am delighted with decision and look forward to the CJEU [court of justice of the European Union] determining the substantive question. I want to thank our legal team for their considerable efforts and determination.”

The SNP’s Joanna Cherry, the only MP to remain in the group after warnings from the government that the action was breaching parliamentary privilege, also welcomed the ruling, saying it was “vital for MPs to know whether article 50 is unilaterally revocable before they are asked to ratify any agreement between the UK and the EU council.

“Given Theresa May’s humiliation in Salzburg yesterday the answer to this question is particularly important. I look forward to the court of justice of the European Union’s ruling.”