Image copyright Getty Images

Legislation which could pave the way for a new Scottish independence referendum has been tabled at Holyrood.

The Scottish government wants to put the question of independence to a new public vote in the second half of 2020.

However, the Referendums (Scotland) Bill does not set a date or question, with ministers seeking agreement with the UK government

First Minister Nicola Sturgeon said "now more than ever it is essential that we keep Scotland's options open".

Constitutional Relations Secretary Mike Russell gave a statement to MSPs on Wednesday afternoon about the bill and plans for a "citizens' assembly" to discuss Brexit and independence.

The Scottish Conservatives said the "latest stunt" was "all about Nicola Sturgeon pandering to her party, not speaking for the country".

Ms Sturgeon announced in April that she wanted a new independence referendum to happen before the end of the current Scottish Parliament term in 2021.

She told MSPs that she wanted to secure a "Section 30 order" - an agreement similar to that underpinning the 2014 referendum - from the UK government before doing this, to put the vote "beyond doubt or challenge".

The UK government has so far rejected such an agreement, but Ms Sturgeon said she would bring forward legislation to "set the rules for any referendum that is now or in the future within the competence of the Scottish Parliament".

She wants the legislation to be passed by the end of this year, with a view to applying it specifically to a second independence referendum in the event a deal is struck with UK ministers.

If such an agreement is secured, then the question, date and referendum period could be added to the bill via secondary legislation.

The bill as it stands has been ruled within Holyrood's remit by Presiding Officer Ken Macintosh.

Image copyright Getty Images Image caption Mike Russell gave a statement to MSPs about the bill on Wednesday afternoon

Speaking ahead of Wednesday's statement, Ms Sturgeon said that "Scotland must have the chance to choose a better future than the one being offered by Westminster".

She added: "An independence referendum within this parliamentary term will give Scotland the opportunity to choose to be an independent European nation - rather than have a Brexit future imposed upon us.

"We will seek agreement to a transfer of power at an appropriate point to enable an independence referendum that is beyond challenge to be held later in this parliament.

"It is essential the UK government recognises that it would be a democratic outrage if it seeks to block such a referendum - indeed, any such stance would, in my view, prove to be utterly unsustainable.

Why is Nicola Sturgeon making indyref2 plans?

Analysis by Sarah Smith, Scotland editor

Image copyright Getty Images Image caption Independence supporters have held regular marches in Scottish towns and cities calling for a second referendum

Nicola Sturgeon has no intention of going ahead with an independence referendum that has not been authorised by Westminster.

It may be very frustrating to her that the UK government need to give their consent to another vote, but she does accept that it is the reality.

The first minister also knows that it is extremely unlikely that any incoming prime minister would give their approval for another indyref.

We may not know who the next Tory leader is going to be - but you can be sure that any candidate who wants to secure the votes of Conservative members in Scotland will need to firmly rule out allowing a second referendum anytime soon.

So why is Ms Sturgeon going ahead with preparations for a referendum that seems unlikely to happen within her preferred timescale of the second half of next year?

She says that the UK government is currently in such chaos it is not possible to predict what their future policy on anything might be.

And she warns that denying Scottish voters the right to make a choice about whether they want to live in an independent country is not only undemocratic but also politically unsustainable

And that is the argument you will keep hearing from the SNP. That to deny a vote exposes what they describe as the "democratic deficit" facing Scotland.

Read more from Sarah

MSPs clashed over the plans when Mr Russell gave his statement at Holyrood on Wednesday afternoon.

He outlined his hope that the bill would pass by the end of 2019, and set out plans for a Citizens' Assembly to discuss Scotland's future over the coming months.

He also offered cross-party talks about the constitution "with no preconditions", starting in June.

But Scottish Conservative constitution spokesman Adam Tomkins said the statement was about "Nicola Sturgeon's pet obsession with independence", saying that "she must think our heads button up the back".

He said the legislation gave sweeping powers to ministers and was a "Trojan horse for a wildcat indyref2".

Scottish Labour leader Richard Leonard said it was his party which had delivered devolution, and said the SNP's "obsession with the creation of a separate Scottish state is a distraction from the real issues that this parliament was brought into existence to tackle".

Scottish Green co-convener Patrick Harvie backed the legislation, saying a vote should be held within the current parliamentary term and hitting out at how the 2016 EU referendum campaign was conducted.

And Scottish Lib Dem leader Willie Rennie said ministers had "learned nothing from the chaos of Brexit", saying that the government's precondition of holding a referendum was a "major barrier" to his party joining any cross-party talks.