The European Commission "may have set itself on a collision course" with the courts with its "schizophrenic" stance on Scottish independence, a Scottish Parliament adviser has said.

Dr Daniel Kenealy, adviser to Holyrood's European and External Relations Committee, said suggestions by EC president Jose Manuel Barroso and others that a seceding country would be a "new state" and would have to reapply for membership "is entirely inconsistent with the general principles of the EU".

Unionists argue Scotland faces a potentially prolonged EU accession if it becomes independent.

But Dr Kenealy said the process of expelling a country is equally problematic, pointing out that it took six years to negotiate the departure of Greenland.

He has proposed "a practical solution" to Scotland's continuing membership in line with the Scottish Government's White Paper on independence.

But he advised the SNP to abandon its proposals to keep the UK's budget rebate, and to drop its opt-out of the euro - which he said Scotland would not have to adopt anyway.

Writing in the Journal of European Integration, Dr Kenealy said: "The EU would border on the schizophrenic were it to expel a part of its territory for exercising a democratic right to self-determination.

"If followed to the letter, the commission's position would create a sudden and sharp dislocation within the EU's single market, thus making it impractical.

"In offering a black and white statement on a matter better defined by shades of grey, the commission may have set itself on a collision course with the European Court of Justice at some future date.

"It is entirely inconsistent with the general principles of the EU to seek to expel the territory of Scotland, and potentially to strip millions of their EU citizenship, as a result of the exercise of a democratic right.

"The commission has thus come up with an immediate mechanism of withdrawal from the EU. That mechanism stands in contrast to the formal withdrawal mechanism (which) speaks to the impracticalities of suddenly cutting loose an existing part of the EU's territory.

"The delay and agreement strategy is there precisely to avoid sudden and sharp dislocations in the single market. The principle is that of no immediate or automatic withdrawal or expulsion.

"Greenland's withdrawal is illustrative insofar as it took six years for agreement to be reached on the terms of its departure.

"Implicit in the logic is recognition that the nature of the rights and obligations that flow from the treaties, the interdependencies that it fosters, and the movement of people and capital that is facilities, cannot simply be turned off or reversed."

He said the Scottish Government could negotiate continuing membership under article 48 of the Lisbon Treaty, in line with the SNP's plan, but has advised the Scottish Government "not to use this negotiation as an opportunity to secure their own opt-outs and special provisions".

He added: "It is almost impossible to imagine the member states agreeing to allow Scotland to inherit a version of the UK budget abatement.

"Similarly, the UK's opt-out on the euro, shared only with Denmark, is something that Scotland may be wise not to put up a fight to retain.

"The currency situation in an independent Scotland remains clouded with uncertainty. Scotland would certainly gain a derogation from eurozone membership and, should it choose, could adopt the Swedish option of de facto exercising a right to opt-out of the currency.

"In short, it could not be required to adopt the euro as its currency.

"The one special provision that would be most important for Scotland to retain would be the UK opt-out on various Schengen (passport-free travel) provisions."

SNP MSP Clare Adamson, who sits on the European and External Relations Committee, said: "Dr Kenealy's comments add to the considerable range of experts who have rightly dismissed the scare stories over Scotland's place in the EU.

"Those experts include honorary director-general of the Commission Graeme Avery, who said 'It's obvious that the common sense solution would be for Scotland's membership of the European Union to be effective on the same day as its independence'.

"Scotland has been a part of the EU for over 40 years and it is in absolutely nobody's interest for Scotland to be excluded - which is why it will not happen. Indeed the only threat to Scotland's continued place in Europe is the anti-EU agenda dominating Westminster, which could see Scotland dragged out against our will if there is a No vote in September."