Scotland will leave the European Union whether or not it becomes an independent country, Theresa May has said.

The Prime Minister seized on comments from the European Commission on Monday which indicated that an independent Scotland would have to apply to join the EU, rather than automatically being a member.

Commission spokesman Margaritis Schinas said the "Barroso doctrine" continued to apply.

Former commission president Jose Manuel Barroso set out the legal view that if one part of an EU country became an independent state it would have to apply for EU membership.

At Prime Minister's Questions, Mrs May said: "Scotland will be leaving the European Union, it will leave the European Union either as a member of the United Kingdom or were it independent. It's very clear with the Barroso (doctrine), it would not be a member of the European Union.

"What we need now is to unite, to come together as a country and to ensure that we can get the best deal for the whole of the United Kingdom."

Mrs May made her view clear as she clashed with SNP depute leader Angus Robertson at Prime Minister's Questions.

He had previously told The Guardian a deal could still be done to avert a second independence referendum.

Scottish First Minister Nicola Sturgeon announced her intention to stage a fresh ballot, but Mr Robertson said the party was "currently focused ... trying to convince the UK Government to come to a compromise agreement protecting Scotland's place in Europe".

He recalled that when Mrs May held talks with the First Minister in July last year she had "promised to secure a UK-wide approach, an agreement between the devolved administrations of Scotland, Wales and Northern Ireland and the UK Government, before triggering Article 50".

Pressing the PM, Mr Robertson demanded: "When will she reach an agreement - not discussions, an agreement - with the Scottish Government before triggering Article 50?"

He continued: "The Prime Minister promised an agreement, there's not an agreement. When will there be an agreement? Because does she not understand if she does not secure an agreement before triggering Article 50, if she is not prepared to negotiate on behalf of the Scottish Government and secure membership of the single European market, people in Scotland will have a referendum."

Mrs May reiterated her Government will trigger Article 50, to start the formal Brexit process, before the end of March, adding there would be "an opportunity for further discussions with the devolved administrations over that period".

But she told the SNP MP: "He is comparing membership of an organisation we have been a member of for 40 years with our country.

"We have been one country for over 300 years. We have fought together, we have worked together, we have achieved together, and constitutional game-playing must not be allowed to break the deep bonds of our shared history and our future together."

The Prime Minister added: "We have been in discussions with the Scottish Government and with the other devolved administrations about the interests they have as we prepare, as the United Kingdom Government, to negotiate a deal on behalf of the whole United Kingdom - a deal which will be a good deal not just for England, Wales and Northern Ireland, but for the people of Scotland as well."

While the Scottish Government is planning for a second independence referendum some time between autumn 2018 and spring 2019, an SNP source denied reports the First Minister will attempt to get an independent Scotland into the European Free Trade Association (EFTA), which includes Norway and Iceland and participates in the single market, rather than rejoin the EU as a full member.

The comments came as a new report found support for Scottish independence is higher than ever but the ''potentially divisive'' issue of the European Union may make it difficult for nationalists to win a second referendum, and two separate polls put support for independence at 43% and 47% once the undecided were excluded.

A senior Labour source said that party leader Jeremy Corbyn believed that the decision on whether or not to hold a second independence referendum should be taken by the Scottish Parliament and that it would be wrong for Westminster to try to block it.

"The Labour Party and Jeremy Corbyn are opposed to holding a second referendum and we will campaign against independence in that referendum," said the source.

"However, we have also made clear that we think it would be completely wrong for Westminster to block that referendum if the Scottish Parliament has voted for it. The decision on whether to hold such a referendum is for the Scottish Parliament and the Scottish people."

Asked whether Mr Corbyn was a "unionist", the source said: "The term 'unionist' has all sorts of baggage around it which people are often keen to avoid. But the Labour Party and Jeremy Corbyn are in favour of maintaining the country together and the union."