The UK can unilaterally revoke its withdrawal from the EU, according to a European Court of Justice advocate general's legal opinion.

Manuel Campos Sanchez-Bordona rejected the contention that Article 50 only allows the possibility of revocation following a unanimous decision of the European Council.

Instead, he said Article 50 allows the "unilateral revocation of the notification of the intention to withdraw from the EU, until such time as the Withdrawal Agreement is formally concluded".

The case to decide whether an EU member state such as the UK can decide on its own to revoke the Article 50 withdrawal process, or whether the agreement of the 27 other member states would be required, was brought by a cross-party group of Scottish politicians.

The opinion, which is not binding on the court, comes just a week after the case was heard at the ECJ following a referral from Scotland's highest civil court, the Court of Session.

A judgement by the court will take place at a later date.

Scottish Government constitutional relations secretary Michael Russell said: "I welcome the Advocate General's opinion, and look forward to the final judgement of the Court of Justice.

"Rejecting a bad deal must not mean leaving with no deal.

"It is a tribute to the perseverance of the Scottish parliamentarians involved that we will finally get clarity from the Court of Justice on this important question."

Those who brought the case argue unilateral revocation is possible and believe it could pave the way for an alternative option to Brexit, such as a People's Vote to enable remaining in the EU.

Legal representatives for the UK Government believe the case is inadmissible as it deals with a hypothetical situation, since the Government's policy is not to revoke Article 50.

Lawyers representing the Council of the European Union and from the European Commission argue revocation is possible but would require unanimous agreement from all member states.

The case was brought forward in February by a group of Scottish politicians - Labour MEPs Catherine Stihler and David Martin, Joanna Cherry MP and Alyn Smith MEP of the SNP, and Green MSPs Andy Wightman and Ross Greer, together with lawyer Jolyon Maugham QC, director of the Good Law Project.

Their request for the Court of Session to refer the question of whether Article 50 can be unilaterally revoked to the ECJ was initially refused, before that ruling was overturned on appeal.

Two attempts by the UK Government, which is contesting the case, to appeal against the referral to the European court were rejected.

At the hearing last week, Aidan O'Neill QC, representing the politicians who brought the case, said they need to know all their options on Brexit, including whether the UK can unilaterally halt the process ahead of critical votes on the withdrawal agreement.

Advocate General for Scotland Lord Keen QC, representing the UK Government, said the case is a "hypothetical validity challenge" and those behind it seek "political ammunition to be used in, and to pressure, the UK Parliament".

Hubert Legal, representing the Council of the European Union, said allowing unilateral withdrawal could lead to "disaster", of which "the main victim could be the European project altogether".

He said Article 50 is "not ambiguous", adding: "The prerogative of acting alone will have been exhausted by putting the notification letter on the council's table."

Lord Kerr, one of the architects of Article 50, said: "This is no surprise and, if the court agrees, will confirm that it is still up to us to decide whether we want to keep the existing deal we've got in the EU rather than leave on the Government's terms.

"The choice facing us is not simply between the Government's deal and no deal. We can choose to change course. There is still time and, until the UK has left the EU, the Article 50 letter can be withdrawn.

"Despite some of the bogus claims that have been made by those who oppose staying in the EU, there would be no price to pay - political or financial - if we were to take back the Article 50 letter.

"With support growing across the country for a People's Vote, it is clear to me that this is the best way forward. The people should have the right to choose."

The Prime Minister's official spokesman told reporters in Westminster "this is not a final judgement" and "it does nothing in any event to change the clear position of the government that Article 50 is not going to be revoked".