The advocate general of the European Court of Justice – which deals with EU law – has declared that the UK can withdraw Article 50 without consulting other member states.

This would effectively mean postponing, or possibly cancelling altogether, the country’s exit from the EU – which may pave the way for a second referendum on the issue in the UK.

The advocate general gave his opinion after a case was brought by a group of Scottish politicians who wanted to check the legal possibility of the UK unilaterally revoking Article 50.

According to Manuel Campos Sanchez-Bordona, the EU’s top law official, Article 50 “allows the unilateral revocation of the notification of the intention to withdraw from the EU, until such a time as the withdrawal agreement is formally concluded”.

This would mean that the two-year period to achieve an agreement – which began in March 2017, when Article 50 was triggered, and is due to end in March next year – could be extended.

Although the advocate general’s opinion is not binding on the European Court of Justice, the latter usually follows this advice.

The news comes as the UK prime minister, Theresa May, gears up for a week of debates to try and pass her withdrawal agreement in the House of Commons – which is being seen as an uphill task.

She faces particular challenges from the pro-Brexit faction in her own party, which opposes several aspects of the agreement, including the Northern Ireland backstop, the purpose of which is to avoid a hard border on the island of Ireland.

The Democratic Unionist Party, (DUP), who are in coalition with May’s Conservative Party, are also opposed to the backstop, and intend to vote the agreement down.