Law officers' advice on Scotland's future in the European Union if it becomes independent now exists but it will not be published, the Deputy First Minister has confirmed.

Nicola Sturgeon told MSPs that she would "of course" confirm remarks by External Affairs Secretary Fiona Hyslop in a BBC Newsnight interview last month that the advice has been received by ministers.

The Scottish Government took the Information Commissioner to court to defend its position that it does not confirm the existence of law officers' advice.

Before the case began, Ms Sturgeon told MSPs in October the she obtained "prior permission from the Lord Advocate to tell Parliament that we have now commissioned advice. The permission does not extend any further than that".

Labour MSP James Kelly asked today what recent advice the Scottish Government received regarding membership of the EU should Scotland separate from the UK.

"Will the Deputy First Minister confirm what Fiona Hyslop told Newsnight on May 15 that the Government has indeed received legal advice on EU membership should Scotland separate from the UK?" he said.

"Can she confirm that that advice states that EU membership will not automatically transfer?"

Ms Sturgeon said: "Yes, I confirm what Fiona Hyslop said. Of course I do. There is a long-established convention of both the UK and Scottish governments that law officers' advice is not published, and there are good and sound reasons for that convention."

The Scottish Ministerial Code states: "The fact that legal advice has or has not been given to the Scottish Government by the law officers and the content of any legal advice given by them or anyone else must not be revealed outwith the Scottish Government without the law officers' prior consent."