Professor Miguel Poiares Maduro, a former Advocate General at the European Court of Justice, today indicated that the UK Government was wrong to rule out a stand-alone Scottish deal with the EU in the aftermath of Brexit.
He suggested Scotland could have thrived economically under such a scenario.
The Scottish Government had proposed such an arrangement with publication of a paper entitled Scotland's Place in Europe after a majority of Scots voted to remain in the EU in last year's referendum. But this was ruled out by UK Brexit Secretary David Davis last week who said it would not be practical.
The prospect of Scotland now being "dragged out the EU against its will" is now driving Nicola Sturgeon's demands for a second independence referendum.
Prof Maduro, a former Portuguese Government minister, was giving evidence to the European Parliament's committee on Constitutional Affairs about Brexit preparations and said there was an alternative to a straight split between the EU and UK.
"There is another possibility that is to have that some UK citizens maintain citizenship of the European Union and other won't," he said.
"Nothing prevents a part of the United Kingdom to stay and another part of the United Kingdom to leave. We have a precedent with that - it's called Greenland."
Greenland, an autonomous territory of Denmark, left the EU in the mid-80s while Denmark remained.
Prof Maduro added: "We have the case of one member state where part of its territory left the European Union and the other part stayed.
"So in principle nothing would prevent the territories, for example, of Northern Ireland and Scotland to stay in the European Union and for the rest of the territory of the United kingdom no longer to be part of the European Union.
"Of course this will be complex to organise in practice. It will require a border inside a member state because Scotland and Northern Ireland will remain part of the United Kingdom, but it will not be impossible.
But he admitted it would "politically problematic" and the consequences could make it difficult.
"One risk will be economic for the UK because naturally you will have, I would say for Scotland and Northern Ireland it would be extremely positive. It will attract lots of investment and companies will locate in these territories because they could benefit from both those markets."