Media playback is unsupported on your device Media caption Nicola Sturgeon says a second independence referendum will need a transfer of power from Westminster

Nicola Sturgeon has said she wants to hold a second referendum on Scottish independence by 2021 if the country is taken out of the EU.

The first minister told Holyrood that she would introduce legislation soon to set the rules for another vote.

But she indicated that she would need the agreement of the UK government before actually holding a referendum.

Downing Street has previously said it will not grant a new Section 30 order, which underpinned the 2014 referendum.

Ms Sturgeon claimed this position was "unsustainable" and challenged her party to increase support and demand for independence.

But the prime minister's official spokesman said: "As we have been repeatedly clear, Scotland has already had an independence referendum in 2014 and voted decisively to remain in the United Kingdom. This should be respected. Our position hasn't changed."

Ms Sturgeon has faced calls from some within the SNP - which will hold its conference at the weekend - and the wider independence movement to hold a referendum sooner rather than later.

She told MSPs that to "rush into an immediate decision before a Brexit path has been determined would not allow for an informed choice to be made" about the future.

However, the first minister added: "If we are to safeguard Scotland's interests, we cannot wait indefinitely.

"That is why I consider that a choice between Brexit and a future for Scotland as an independent European nation should be offered in the lifetime of this parliament.

"I can confirm that the Scottish government will act to ensure that the option of giving people a choice on independence later in this term of parliament is progressed."

The next Scottish Parliament election is due to be held in May 2021.

Media playback is unsupported on your device Media caption Brexit versus Scottish independence

Ms Sturgeon believes she has a mandate to hold a second independence referendum as a result of the SNP's victory in the 2016 Holyrood elections - with the party's manifesto stating a vote should take place if there was a "material change of circumstances" such as Scotland being taken out of the EU against its will.

The first minister said she hoped a "framework Bill" - legislation paving the way for a referendum - will be in place by the end of this year.

She said: "We do not need a transfer of power such as a Section 30 order to pass such a framework Bill, though we would need it to put beyond doubt or challenge our ability to apply the bill to an independence referendum."

The first minister insisted: "If we are successful in further growing the support and the demand for independence, then no UK government will be able to stop the will of the people or stop that will being expressed."

Image copyright Getty Images Image caption The SNP conference will be held at the weekend - with Ms Sturgeon due to speak on Sunday

The first minister extended an invitation to other parties, including those opposed to independence, to come forward for their own proposals for Scotland's constitutional future.

She said: "The immediate opportunity we now have is to help stop Brexit for the whole UK - and we should seize that opportunity. But if that cannot be achieved, dealing with the consequences of Brexit and facing up to its challenges will be unavoidable.

"I believe that the case for independence is stronger than ever. I will make that case, but I know others take a different view.

"So, as we take the necessary legislative steps over the next few months, I will also seek to open up space for us to come together and find areas of agreement as mature politicians should."

But she predicted that if the only alternative presented by opposition politicians was a "failed and damaging status quo", then "the process of change will pass them by and support for independence will grow".

Is appealing to your foes the right move?

Analysis by Sarah Smith, Scotland editor

Image copyright Getty Images

Nicola Sturgeon knows that the Westminster government will almost certainly refuse to allow another referendum within the next two years - so she needs to find a way to keep the constitutional argument alive while there is little prospect of an imminent vote.

The SNP know that by proposing another referendum they will be accused by those who do not support independence of introducing a divisive political issue at the worst possible time.

So the first minister is challenging other parties who do not support Scottish independence to come forward with their own ideas for constitutional change, promising that the SNP will engage fully and in good faith.

Ms Sturgeon is very deliberately talking of trying to find compromise and consensus amongst politicians - saying Scotland can do things differently from Westminster.

It is an appeal that is clearly meant to reach beyond other party leaders and straight to voters who may not welcome independence, but might well appreciate the approach the first minister is proposing.

The first minister also announced plans to establish a Citizens Assembly to consider Scotland's future, which she said had been done in Ireland to "help find consensus on issues where people have sharply divided opinions".

She said this would bring together a representative cross-section of Scotland with an independent chair, and be tasked with considering:

What kind of country are we seeking to build?

How can we best overcome the challenges we face, including those arising from Brexit?

What further work should be carried out to give people the detail they need to make informed choices about the future of the country?

Scotland rejected independence by 55% to 45% in the 2014 referendum - with opinion polls suggesting support for independence remains largely unchanged five years later.

Ms Sturgeon initially called for a second referendum after the Brexit vote in 2016, but put her plans on hold after the SNP lost 21 seats in the general election the following year.

Image copyright Reuters Image caption Downing Street says the prime minister is still of the view that there should not be another independence referendum

Speaking after Ms Sturgeon's statement, Scottish Secretary David Mundell said people in Scotland had "voted decisively in 2014 to remain part of the UK, on a promise that the referendum would settle the issue for a generation".

He added: "Instead of respecting that result, Nicola Sturgeon continues to press for divisive constitutional change when it is clear that most people in Scotland do not want another independence referendum. The UK government will stand up for them.

"Nicola Sturgeon needs to listen to the views of the Scottish people and concentrate on improving Scotland's economy and schools, not continually trying to orchestrate upheaval and division."

Scottish Labour leader Richard Leonard accused Ms Sturgeon of "using her office as first minister to put the interests of the SNP before the interests of our country".

He said: "Her statement today is not about Brexit, this is about Nicola Sturgeon trying to pacify her party members and back benchers ahead of the SNP's conference".

The pro-independence Scottish Greens broadly welcomed the first minister's statement.

But the party's Holyrood co-convener Alison Johnstone warned that the SNP's vision of independence "looks more like the failed economic model of the UK, a vision which has led to cuts to public services and increasing child poverty, than the bold vision for independence the Greens campaigned for and believed in".