The Finance Secretary said the Scottish Government wanted to see continuity of Scotland's EU membership, but he accepted it would be faced with "negotiating the details around the terms of that membership".
He said if people voted yes in the 2014 referendum, Scotland's position would be unprecedented in EU terms and, consequently, Holyrood was seeking urgent talks with Brussels.
At one point during evidence to the House of Lords Economic Committee yesterday, Mr Swinney was branded a scoundrel for using "implausible" and "irrelevant" arguments.
Labour peer Lord Lipsey suggested it was "rather bizarre" for the Scottish Government, which had admitted it did not have legal advice on the membership issue, to reject the view of the head of the Commission.
Lord MacGregor, the former Conservative Cabinet minister who chairs the committee, expressed surprise it had taken Mr Barroso's comments to "flush out" the Scottish Government's position on EU membership.
He referred to the EC President's letter to the com-mittee, which stated: "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. 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 to its territory."
However, Mr Swinney told the peers: "Essentially, I don't agree with the contents of President Barroso's letter for the reason that I do not see the basis within the treaties upon which that remark is founded."
He went on: "In the presentation of the letter, Mr Barroso gives a very clear treaty reference to countries that apply to become a member of the EU, Article 49, and I completely accept that treaty reference.
"But in the following paragraph there is not a treaty reference, because there cannot be any treaty reference, because such provisions do not exist."
Lord Lipsey said the treaties only applied to member states, so it was "not relevant whether there's a treaty reference because Scotland is not then a member state".
He added: "To retreat into clearly implausible references to what is referred to in the treaty, to which you would no longer be a signatory because you are no longer part of the EU, seems to me to be the last refuge of a scoundrel."
Lord Lipsey asked if the Scottish Government's position could be "sustained. Mr Swinney said: "Yes, because the point which the committee should be very interested in is the fact there is no foundation in the treaty for the comment Mr Barroso made in that letter."
The Finance Secretary revealed the Scottish Government had already had "very helpful dialogue" with the Bank of England about its plans for monetary union should Scots back independence.
Labour peer Lord Hollick asked what incentive there would be for the Bank of England to be the lender of last resort to a foreign country.
Mr Swinney replied that while the Bank was called the Bank of England it was, in fact, the Bank of the UK. He added: "It would be of interest to the Bank because the Scottish economy would be contributing to the sterling zone."
Mr Swinney's offer of pre-referendum talks with the UK Government in preparation for a yes vote has been rejected.
A senior Whitehall source told The Herald: "That's not our job. It's up to them to set out the case for an independent Scotland."