The non-binding opinion was delivered by the European Court of Justice’s advocate general.
A group of Scottish politicians has asked the court whether the UK can call off Brexit without the consent of other member states.
The Court of Justice (ECJ) will deliver its final ruling at a later date.
The advice from advocate general Manuel Campos Sanchez-Bordona comes as the House of Commons begins five days of debates on Prime Minister Theresa May’s proposed Brexit deal, with a vote due to be held next Tuesday.
In a written statement, the ECJ said Mr Campos Sanchez-Bordona’s opinion was that if a country decided to leave the EU, it should also have the power to change its mind during the two-year exit process specified in Article 50 of the EU treaty.
Also it should be able to do so without needing the consent of the other 27 member states – contrary to what the EU itself has argued.