The Scottish Cabinet is to hold an emergency meeting today - around 24 hours after the shock victory for Brexit campaigners in the European referendum.

The government team will gather in Edinburgh to discuss the next steps they will take after the UK voted to leave the European Union by a margin of 52% to 48%.

The verdict, which emerged in a day of dramatic developments, resulted in David Cameron announcing on Friday that he would step down as Prime Minister before October's Conservative conference.

But by contrast, Scotland opted overwhelmingly to be part of the EU, by 62% to 38%, a difference which prompted First Minister Nicola Sturgeon to warn the UK that a second vote on Scottish independence is now "highly likely".

The SNP leader confirmed her government will begin to draw up the legislation that could see a fresh independence referendum take place within the next two years.

She told a news conference at her official residence on Friday: "As things stand, Scotland faces the prospect of being taken out of the EU against our will. I regard that as democratically unacceptable."

The SNP manifesto for May's Holyrood elections said the Scottish Parliament "should have the right to hold another referendum if there is a significant and material change in the circumstances that prevailed in 2014", such as Scotland being taken out of the EU against its wishes.

"It is, therefore, a statement of the obvious that a second referendum must be on the table, and it is on the table," said Ms Sturgeon, who campaigned for a Remain vote.

When Westminster triggers the process to withdraw from Europe later this year, she said "the UK will be on a two-year path to the EU exit door".

The SNP leader added: "If Parliament judges that a second referendum is the best or only way to protect our place in Europe, it must have the option to hold one within that timescale."

The Scottish Cabinet will discuss its next moves in detail when it gathers on Saturday morning, with Ms Sturgeon expected to issue a further statement following the meeting.

She has already declared her intention to "take all possible steps and explore all options to give effect to how people in Scotland voted".

Some opposition leaders have said they did not want to see another Scottish independence referendum.

Scottish Conservative leader Ruth Davidson, another prominent figure in the pro-EU camp, said such a move is not "in the best interests of the people of Scotland".

Recalling the result of the September 2014 ballot on independence, Ms Davidson said: "The 1.6 million votes cast in this referendum in favour of remain do not wipe away the two million votes that we cast less than two years ago.

"We do not address the challenges of leaving the European Union by leaving our own Union of nations, our biggest market and our closest friends."

Scottish Labour leader Kezia Dugdale, who has discussed the Brexit victory with Ms Sturgeon, said she stands ready to work with the First Minister "in the best interests of the people of Scotland".

But she added: "Now is the time for calm heads. Labour's manifesto ruled out a second referendum in the lifetime of this Parliament - we won't be changing our minds any time soon.

"However, on the question of independence, many of the fundamental questions that were unresolved and unanswered in 2014, remain so. Not least the question of currency."

Scottish Liberal Democrat leader Willie Rennie focused on the Conservatives' "reckless gamble" with the country's place in Europe, which he said is now hammering the economy.

But he added: "Brexit is risking the future of the United Kingdom, too, with the SNP hungry for another referendum on independence."

Meanwhile, the UK win for the Leave side was welcomed by US Republican presidential candidate Donald Trump, who hailed it as an "amazing vote" during his visit to Scotland.

Hundreds of people took part in protests north of the border in the wake of the result.

Demonstrators gathered outside the Scottish Parliament in Edinburgh and in Glasgow's George Square to show their support for migrants and protest against the "torrent of racism" they said was "unleashed" during the referendum campaign.