Scotland's First Minister Nicola Sturgeon used Brexit on Friday to reaffirm her commitment to holding a new independence referendum this year and raised the possibility of taking the British government to court over the issue.

Her speech from Edinburgh comes two days after Scotland's parliament backed holding a second vote on splitting from London and despite British Prime Minister Boris Johnson recently refusing a request for a fresh referendum.

Sturgeon claimed Scotland is being "taken out" of the bloc despite a majority of Scots — 62% — voting to remain in the 2016 referendum.

Scots rejected breaking away from the rest of the UK in 2014 referendum, with 55.3% voting against, and 44.7 in favour.

"As of 11 pm (midnight CET) tonight, the UK that Scotland voted to remain part of in 2014, a UK inside the EU, will no longer be a reality. The status quo that a majority voted for will no longer exist. There will be a material change in the circumstances that prevail in 2014," she told activists for her Scottish National Party (SNP).

Brexit, she added, will have "significant" consequences that Scotland cannot mitigate or avoid and said that therefore the country has "a cast-iron democratic mandate" to hold a new referendum.

'Legal and legitimate'

But she warned that there are obstacles in the way to holding the ballot, including the issue of legality.

"To achieve independence, a referendum (...) must be legal and legitimate" and its legality "must be beyond doubt" in order for the outcome to be recognised by other countries, she said.

For Sturgeon, the best outcome would be for the British government to agree to a transfer of power but she raised the possibility of the Scottish parliament holding a consultative referendum and then taking the matter to court if denied by Westminster.

"The issue of whether the specific constitutional reservation in the Scotland Act puts any form of independence referendum outside the powers of the Scottish Parliament – or instead leaves open scope for a non-binding consultative vote – has never been tested in court," Sturgeon said.

"That means it cannot be said definitively that it would not be legal, but equally it cannot be described as being beyond legal doubt.

"If a proposal for a referendum on that basis was brought forward it would be challenged in court.

"If a court ruled that it was legal, it wouldn’t be a “wildcat referendum” as our opponents like to brand it – it would be within the power of the Scottish Parliament," she went on.

A YouGov poll released on Thursday found that the "Yes" vote leads the "No" by 51% to 49%.

It is the first time since early 2015 that the pollster gave the "Yes" vote the lead which it attributes to Remainers increasingly backing independence.

"Over one in five (21%) of those who voted Remain in 2016 but No in the independence referendum have now shifted over the Yes," the pollster said.

However, a clear majority — 56% — is against a new referendum this year.