The first minister said she believed a second referendum on independence was highly likely after Scotland voted overwhelmingly to remain within the EU, but was unable to prevent the leave campaign winning by 52% to 48% across the UK as a whole.

Sturgeon said that was a “democratic outrage” and constituted the clear, material change in Scotland’s circumstances referred to in the Scottish National party’s carefully worded manifesto commitment in May to hold a second independence vote if needed.

“It is a significant material change in circumstances. It’s a statement of the obvious that the option of a second independence referendum must be on the table, and it is on the table,” she said.

Sturgeon announced that she was instructing Scottish government officials to draft fresh referendum legislation for Holyrood, only two years after her party lost the first independence vote in 2014, to ensure it could be held quickly if enough Scottish voters backed it.

UK government sources said David Cameron, who quit as prime minister after the referendum defeat, was anxious that his successor make sure the Scottish, Welsh and Northern Ireland government were closely involved in the UK’s Brexit negotiations to avoid increasing Scottish grievances and fuelling the case for independence.

Sturgeon’s cabinet will meet in emergency session on Saturday morning at her official residence Bute House, and is expected to agree plans to put forward referendum legislation in September’s programme for government.

Holyrood would need Westminster’s legislative approval to stage an official referendum, as it did in 2014. Cameron had previously said no UK government would give that again so soon, but Sturgeon said on Friday it would be inconceivable for Westminster to ignore a democratic vote by MSPs requesting that authority.

In a significant boost to her strategy, MSPs in the Scottish Green party indicated she could win the six Scottish Green votes in the Scottish parliament that she needs to ensure a Holyrood majority, as momentum behind a second vote sharply rose after the UK result became clear.

The most recent polls suggest independence does not yet have clear majority support, but SNP sources and activists within Women for Independence (WFI) said there had been a surge in membership requests on Friday, with people offering to campaign and donating money.

The SNP said it had been inundated with emails from previous no voters now pledging their support for independence after the conclusion of the EU referendum. The Radical Independence Campaign, which was heavily involved in registering first-time and alienated working-class voters during the last referendum campaign, likewise reported an increase in donations. “The surge is back on,” said one WFI activist.

Echoing earlier remarks by her predecessor Alex Salmond, Sturgeon said it made clear logical sense for those powers to be in place quickly and before the UK’s exit from the EU was completed by an expected deadline of 2018. There will be added urgency to that timetable after senior European commission and parliament figures said they wanted the Brexit talks speeded up, and for the UK to leave as soon as possible to lessen the uncertainty now facing the EU.

Sturgeon said pressing ahead with an independence bill would ensure a seamless transition for Scotland from having EU membership as part of the UK to having it as an independent nation. She said her primary concern was to ensure that Scotland’s vote to remain in the EU, by 62% to 38%, was brought into effect.

She said she would “take all possible steps and explore all options to give effect to how people in Scotland voted. In other words, to secure our continuing place in the EU and in the single market in particular.”

Sturgeon is writing this weekend to all EU member states to set out her case for Scotland remaining in the EU and to press for urgent talks in Brussels with the European commission president, Jean-Claude Junker, during which she will emphasise Scotland’s strong pro-European vote.

Salmond said staging a quick referendum was the most obvious solution. “The logic would be that Scotland would have the option of remaining within Europe while the rest of the UK left Europe, so there would be no logic in saying: let Scotland go out and then come back in again,” he told BBC Radio Scotland.

“We proved that we are a modern, outward looking, open and inclusive country,” he said. “And we said clearly that we do not want to leave the European Union. I am determined that we will do what it takes to make sure that these aspirations are realised.”

Sturgeon was careful to avoid giving any guarantee, however, that a second referendum would be held, stressing that the challenges of leaving the UK were complex and still unclear because the UK-EU negotiations had not yet begun.

The SNP would face significant economic, legal and political questions about leaving the UK. With the collapse in oil prices but high levels of public spending, it has a structural deficit of £15bn, and a weak economy hovering close to recession.

It would need to strike a deal with London about paying off its share of the UK’s £1.6tn debt. It would also face losing Scotland’s share of the UK rebate, having to find the cash needed for Scotland’s contribution to the EU, and require the EU’s agreement on its currency. EU members may expect Scotland to join the euro.

'I'm now hoping for independence': Scottish readers on Brexit

Read more

Salmond ruled out that prospect on Friday morning. Implying that work was under way on alternatives to retaining sterling, he said. “There are a range of other options obviously, such as sterlingisation, an independent Scottish currency linked to the pound; an independent Scottish floating currency.”

The author JK Rowling, who voted against independence, has implied she may now rethink her position, and Salmond said major Scottish employers and companies such as the whisky giant Diageo would consider whether Scottish independence within the EU would ensure their continued access to the European single market.

“There’s going to be rethinking by a whole range of companies because access to that marketplace is key to prosperity and one thing I’m sure Nicola Sturgeon won’t allow is the livelihoods of Scottish workers and their families being sacrificed and jeopardised by the incompetence of Westminster politicians,” Salmond told BBC Radio’s Good Morning Scotland.

• This article was amended on 26 June 2016. An earlier version referred to Sturgeon setting out her case for Scotland remaining in the UK, when the EU was meant.