Deputy First Minister Nicola Sturgeon has called for early talks about an independent Scotland's place in the EU in response to comments that the country may have to reapply.
Jose Barroso, president of the European Commission, which governs the EU, prompted the move by saying it is "obvious" that a newly independent state would need to apply for membership.
Ms Sturgeon said "no serious person" can argue that it would be in anyone's interest for Scotland to be denied continuous membership.
Prime Minister David Cameron said Mr Barroso had made a "significant intervention", while opposition parties at Holyrood seized on the comments to criticise the SNP position.
In an interview, Mr Barroso was asked if Scotland would need to reapply to join the EU if it leaves the UK following a referendum due to be held in 2014.
"I did not comment on specific situations of member states because I very much respect that it is their right, their sovereign right to decide about their organisation," he told the BBC's Hardtalk programme.
"Now, what I said, and it is our doctrine and it is clear since 2004 in legal terms, if one part of a country — I am not referring now to any specific one — wants to become an independent state, of course as an independent state it has to apply to the European membership according to the rules. That is obvious."
Despite that comment, there is no consensus between the two sides of the independence campaign on what would happen to Scotland.
The Scottish Government argues that the country would be able to negotiate from within the UK, the member state, after a Yes vote but before formal independence.
Unionists say Scotland would be left outside the EU until it was reaccepted, potentially forcing the country to adopt the euro currency and join the Schengen free-travel area, putting it at odds with England.
There is no precedent for part of an existing member state becoming an EU state in its own right.
Mr Barroso said a hypothetical new state would need to renegotiate terms.
"We are a union of states, so if there is a new state, of course, that state has to apply for membership and negotiate the conditions with other member states," he said.
Asked specifically about Scotland, he said: "For European Union purposes, from a legal point of view, it is certainly a new state. If a country becomes independent it is a new state and has to negotiate with the EU."
Ms Sturgeon challenged Mr Barroso's comments, arguing that the "real" threat to membership comes from eurosceptics at Westminster.
"We do not agree that an independent Scotland will be in the position of having to reapply for European Union membership because there is no provision for removing EU treaties from any part of EU territory, or for removing European citizenship from the people of a country which has been in the EU for 40 years," she said.
"We are now seeking early talks with the European Commission to discuss the specific process of Scotland becoming independent. As the commission has said before, the matter cannot be separated from specific circumstances, and we now have those specific circumstances as outlined in the Edinburgh agreement."
The agreement was signed between the Scottish and British governments on October 15, paving the way for a legally binding referendum. Both governments pledged to honour the outcome of the ballot and work in the "best interests of the people of Scotland and of the rest of the United Kingdom".
Ms Sturgeon said: "The real threat to Scotland's continued EU membership comes not from independence but from the growing euro-scepticism affecting the UK Government.
"We have always said that the specific terms of Scotland's continued EU membership as an independent nation will be negotiated, but the crucial point is that these negotiations will take place from within the EU because in the period immediately following a Yes vote in the referendum, Scotland will still be part of the UK and the EU.
"No serious person can argue that it is anything other than in the interests of the EU to keep Scotland in continuous membership, given this country's huge natural resources in energy and other aspects which make us such a valuable European partner."
Mr Cameron said that Mr Barroso's comments are "significant" and "telling".
Asked at a Westminster lunch whether he agreed with the president, Mr Cameron said: "The weight of evidence would seem to be that if you leave the United Kingdom, you have to reapply. That is what is being said by the commission and others. I think there is more work we could do on this.
"What I say to Alex Salmond is he in a way wants to have his cake and eat it. He wants to say 'I want to separate from the UK. I want this new future for Scotland'. But on the other hand, he doesn't want the consequences that flow from that.
"I think it is right we are having this debate, it is right that we are having this referendum. It is frustrating that we have to wait to 2014 but at least we have a deal, so a proper debate can be held. In my view, I think these interventions from Barroso and others are proving very telling."
Former chancellor Alistair Darling, who leads the pro-Union Better Together campaign, said: "This issue has nothing to do with the terms that have been agreed for the referendum. The problem that the separatists have is not with the rest of the UK, it is with convincing all of the other member states of the EU that Scotland should be admitted to the EU and not have to join the euro."
Blair Jenkins, chief executive of pro-independence group Yes Scotland, said: "If the people of Scotland wish to remain in the EU, it is inconceivable that they would be forced to leave or that there would be any circumstances in which the EU would not want Scotland to be a member."
Opposition groups at Holyrood criticised the SNP position.
Labour constitutional spokeswoman Patricia Ferguson MSP said: "For months Alex Salmond and Nicola Sturgeon have put their heads in the sand, ignored the warnings about Scotland's future in the EU and pretended that everything will be fine. That is no longer an option."
Scottish Liberal Democrat leader Willie Rennie MSP said: "Alex Salmond has to explain how he will avoid adopting the euro, how he will keep the rebate and maintain open borders with rest of the UK. That could be the high price Scotland pays in any negotiations."
Scottish Conservative leader Ruth Davidson MSP said: "The uncertainty being experienced now because of the referendum would simply intensify, yet the SNP blunders on regardless."
Responding to Mr Barroso's remarks, Scottish Secretary Michael Moore said: "The commission president's comments are not surprising. We have said for some time that if Scotland were to leave the UK, the most likely is that it would need to seek EU membership on newly negotiated terms while the rest of the UK would continue as a member state.
"That would mean Scotland needing to negotiate from a position of weakness, with all the implications that would have for agriculture, fisheries and the economy. These are risks we do not face as part of the UK, a current, large and influential member.
"And there is a bigger lesson here. The Scottish Government's assertions on this issue have been exposed. This debate must be based on robust evidence and fact. Our view has been based on legal and academic evidence while their position has been based on nothing. That is why we are where we are."
Mr Moore was speaking from Washington DC at the start of a three-day visit to the US and Canada.
Meanwhile, the Scottish Conservatives have requested the Scottish Government make an statement to the Scottish Parliament to clarify the situation.
Chief whip John Lamont MSP made the request on Monday afternoon.
"This issue is of sufficient importance for either the First Minister or his deputy to come to the chamber and offer an explanation.
"He and other members of the SNP have told the Scottish Parliament on a number of occasions that a separate Scotland would automatically become part of the EU. Today we heard an entirely contradictory view from the president of the European Commission.
"If anyone knows, he does. So either the SNP has to admit it was wrong and misled Parliament on the issue, or state that it categorically disagrees with the view of Mr Barroso."