A top official at the European Union's highest court advised Tuesday that Britain can unilaterally change its mind about leaving the European Union, boosting hopes among to pro-EU campaigners in the U.K. that Brexit can be stopped.

Prime Minister Theresa May's government insists it will never reverse the decision to leave, but May faces a tough battle to win backing in Parliament before lawmakers vote next week on whether to accept or reject the divorce agreement negotiated with the bloc. Defeat would leave the U.K. facing a chaotic "no-deal" Brexit and could topple the prime minister, her government, or both.

Advocate General Manuel Campos Sanchez-Bordona told the European Court of Justice that a decision by the British government to change its mind about invoking the countdown to departure would be legally valid. The advice of the advocate general is often, but not always, followed by the full court.

The court is assessing the issue under an accelerated procedure, since Britain is due to leave the bloc on March 29. The final verdict is expected within weeks.

Britain voted in 2016 to leave the 28-nation bloc, and invoked Article 50 of the EU's Lisbon Treaty in March 2017, triggering a two-year exit process. Article 50 is scant on details — largely because the idea of any country leaving the bloc was considered unlikely — so a group of Scottish legislators asked the courts to rule on whether the U.K. can pull out of the withdrawal procedure on its own.

The EU's governing Commission and Council oppose unilateral revocation, arguing it requires unanimous agreement of the 27 remaining members of the bloc.