The First Minister replied: "We have, yes, in terms of the debate."
Ms Sturgeon insisted ministers had "never confirmed whether or not we did have legal advice because we're not allowed to do so under the ministerial code".
She told BBC Radio Scotland's Good Morning Scotland programme: "We were very deliberately not confirming whether we had legal advice."
But she conceded the impression had been created that ministers had already taken legal advice on the matter.
She stated: "Given the fact that previously I think the impression had been created that we had legal advice that we were not prepared to reveal because somehow it did not suit our purposes, I think was an unfortunate one. Therefore when we were in a position to seek that legal advice we decided, I decided, to seek the permission of the Lord Advocate to tell the Scottish Parliament that."