The UK can cancel Brexit without the permission of the other 27 EU members, the European Court of Justice ruled on Monday.
The court in a statement said: "When a member state has notified the European Council of its intention to withdraw from the EU, as the UK has done, that member state is free to revoke unilaterally that notification."
"That possibility exists for as long as a withdrawal agreement concluded between the EU and that member state has not entered into force or, if no such agreement has been concluded, for as the two-year period from the date of the notification of the intention to withdraw from the EU, and any possible extension, has not expired," stated the ruling tweeted by the court.
The judges ruled that this could be done without altering the terms of Britain's membership. The ruling came ahead of a House of Commons vote on Prime Minister Theresa May's Brexit deal with the EU on Tuesday. The MPs are widely expected to reject her proposals, reports said.
The court rejected arguments from both the UK government and the European Commission that Article 50, the two-year-long process that triggers a member state's departure from the EU, could not be revoked unilaterally.
The court ruling matched legal advice given to the court last week by its Advocate General Manuel Campos Sánchez-Bordona, who said as a sovereign country Britain could reverse its decision even at this stage.
This legal decision is significant because it means Britain could prevent a no-deal Brexit from happening if it wanted, even if May's deal is voted down by MPs.