International Desk: The European Court of Justice has ruled the UK can cancel Brexit without the permission of the other 27 EU members.
The ECJ judges ruled this could be done without altering the terms of Britain's membership.
A group of anti-Brexit politicians argued the UK should be able to unilaterally halt Brexit, but they were opposed by the government and EU.
The decision comes a day before MPs are due to vote on Theresa May's deal for leaving the EU.
MPs are already widely expected to reject the proposals during a vote in the House of Commons on Tuesday night.
BBC Brussels correspondent Adam Fleming said the ruling made staying in the EU "a real, viable option" and that may "sway a few MPs" in the way they vote.
But he said "a lot would have to change in British politics" to see the UK remain in the EU, with Mrs May and the government having to change its mind to make it a "political reality".
A senior ECJ official - the advocate general - said last week he agreed the UK should be able to change its mind about leaving.
His opinion was not legally binding, but the court tends to follow his advice in the majority of cases and it has broadly done so in this ruling.
The statement from the ECJ said the ability for a member state to change its mind after telling the EU it wanted to leave would last as long as a withdrawal agreement had not been entered into, or for the two-year period after it had notified the bloc it was leaving.
If that two-year period gets extended, then a member state could change its mind during that extra time too.
The court said the UK would be able to stay on the same terms it has now - so it would not be forced to join the euro or the Schengen area - where there are no passport controls between countries.
But the decision to stay must "follow a democratic process", so in the UK's case, it would have to be approved by Parliament.
The member state would then have to write to the EU to notify them of the "unequivocal and unconditional" decision.
The ECJ said it made the ruling to "clarify the options open to MPs" ahead of voting on Mrs May's deal.
risingbd/Dec 10, 2018/Mukul