Media playback is unsupported on your device Media caption Jose Manuel Barroso argued any new independent state would have to apply to join the EU

The president of the European Commission, Jose Manuel Barroso, has said that any new independent country would have to apply to join the EU.

The president's comments came despite Scottish ministers insisting an independent Scotland would negotiate its position "from within".

Mr Barroso told the BBC's Hardtalk programme the position was set out in clear legal terms.

The Scottish government is holding an independence referendum in autumn 2014.

Ministers have said that, in the event of a "yes" vote, Scotland would "quite clearly" remain part of the European Union and negotiations would take place "from within that context".

Responding to Mr Barroso's intervention - described by Prime Minister David Cameron as "significant" - Scottish Deputy First minister Nicola Sturgeon said the SNP government did not agree that an independent Scotland would have to reapply for European Union membership.

She said early talks were now being sought with the European Commission to discuss the specific process of Scotland becoming independent.

A letter from Mr Barosso to the House of Lords economic committee, which is examining the independence question, also confirmed his position that a new independent state would "become a third country with respect to the EU".

Mr Barroso, when asked by the BBC whether Scotland's membership would be "nodded through", responded: "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.

His [Jose Manuel Barroso] opinion is, at the very minimum, interesting and influential. Taken to the maximum, it represents arguably a substantive challenge to the SNP position.

"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."

Asked whether an independent country would have to renegotiate its terms, Mr Barroso said: "Yes.".

When further asked whether that negotiation would be from "inside" the EU, the president responded: "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.

"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."

Mr Barroso also said that, if Scotland became independent, the rest of the UK would not have to negotiate a new position, because of the "principle of the continuity of the state".

Media playback is unsupported on your device Media caption The Scottish Deputy First minister, Nicola Sturgeon: "We've always said there would be negotiations"

In response, Ms Sturgeon said: "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.

"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.

A new independent state would, by the fact of its independence, become a third country with respect to the EU and the Treaties would no longer apply on its territory Letter to Lords from Jose Manuel Barroso

If Scots voters vote 'Yes' in the referendum, Scottish ministers will seek to negotiate the terms of independence with Westminster between 2014 and 2016, negotiating their terms of EU membership at the same time.

The SNP says the Edinburgh Agreement between the Scottish and UK governments, which set out the framework for the referendum, commits both sides to work in the best interests of Scotland and the UK, including remaining inside the EU.

Following Mr Barroso's comments, the prime minister told a lunch meeting of journalists he was "not a legal expert' but "it seems as if you leave the UK you have to re-apply".

Mr Cameron went on to say Scottish First Minister Alex Salmond, "wanted to have his cake and eat it", by claiming you could remain in the UK following any vote to leave, and from that position negotiate membership of the EU.

Officials from the House of Lords later released correspondence from Mr Barroso regarding the position of an independent Scotland.

It states: "The EU is founded on the Treaties which apply only to the Member States who have agreed and ratified them. If part of the territory of a Member State would cease to be part of that state because it were to become a new independent state, the Treaties would no longer apply to that territory.

"In other words, a new independent state would, by the fact of its independence, become a third country with respect to the EU and the Treaties would no longer apply on its territory."

Scotland's opposition parties have argued that Mr Salmond's position on EU membership under Scottish independence was based on "meaningless assertion".

Labour, the Tories and the Liberal Democrats said the consequences of an independent Scotland having to reapply to join the EU could mean having to adopt the Euro and set up border controls with England.