Media playback is unsupported on your device Media caption First Minister, Alex Salmond: "For me as leader my time is nearly over"

Alex Salmond is to step down as Scottish first minister after voters rejected independence.

He will also resign as leader of the Scottish National Party (SNP), which he has led for a total of 20 years.

Scottish voters backed the country staying in the UK by 2,001,926 votes to 1,617,989 in Thursday's referendum.

Three arrests have been made after rival Union and independence supporters gathered in George Square in the centre of Glasgow.

Police, including officers on horseback, had to separate the two groups.

Media playback is unsupported on your device Media caption Rival groups of Unionists and independence supporters are separated by police in Glasgow's George Square

A spokeswoman for Police Scotland said there were about 100 people in each of the two groups, and although there had been some "minor disorder" it had been dealt with quickly, with no arrests so far. The square was closed to traffic with local diversions in place.

The square had hosted a party by "Yes" supporters ahead of the referendum.

BBC Scotland reporter Cameron Buttle, who was at the scene, said the confrontation started quickly with flares being fired and a "co-ordinated" charge from the Unionist side, who were singing Rule Britannia.

Meanwhile, the Queen has said Scotland's vote to stay in the Union was "a result that all of us throughout the United Kingdom will respect".

She added: "Knowing the people of Scotland as I do, I have no doubt that Scots, like others throughout the United Kingdom, are able to express strongly-held opinions before coming together again in a spirit of mutual respect and support."

Elsewhere, Prime Minister David Cameron said the three main Westminster parties would now deliver their campaign pledge to boost the powers of Scotland's devolved parliament.

Referendum reaction

Image copyright EPA

Mr Salmond, 59, is Scotland's longest-serving first minister, having held the post since the SNP won power at the Scottish Parliament in May 2007.

Speaking from his official residence at Bute House in Edinburgh, the first minister told journalists: "For me as leader my time is nearly over, but for Scotland the campaign continues and the dream shall never die.

"I am immensely proud of the campaign that Yes Scotland fought and particularly of the 1.6 million voters who rallied to that cause."

Mr Salmond said he would resign as SNP leader at the party's conference in November, before standing down as first minister when the party elects its next leader in a membership ballot.

He said there were a "number of eminently qualified and very suitable candidates" to replace him.

But Nicola Sturgeon, the current deputy first minister and deputy SNP leader, is seen as a clear frontrunner.

Mr Salmond, who will stay on as MSP for Aberdeenshire East, added: "It has been the privilege of my life to serve Scotland as first minister.

"But, as I said often during the referendum campaign, this is not about me or the SNP. It is much more important than that.

"The position is this. We lost the referendum vote but can still carry the political initiative. More importantly Scotland can still emerge as the real winner."

Ms Sturgeon said she could "think of no greater privilege than to seek to lead the party I joined when I was just 16," but said she would not make an announcement today.

She added: "Alex Salmond's achievements as SNP leader and Scotland's first minister are second to none. He led the SNP into government and has given our country a renewed self confidence."

Mr Salmond also used his resignation statement to question Mr Cameron's more powers pledge.

"We now have the opportunity to hold Westminster's feet to the fire on the 'vow' that they have made to devolve further meaningful power to Scotland," he said.

"This places Scotland in a very strong position.

What the 'No' vote means at home and abroad

"I spoke to the prime minister today and, although he reiterated his intention to proceed as he has outlined, he would not commit to a second reading vote (in the House of Commons) by 27 March on a Scotland Bill.

"That was a clear promise laid out by Gordon Brown during the campaign.

"The prime minister says such a vote would be meaningless. I suspect he cannot guarantee the support of his party."

Many politicians paid tribute to Mr Salmond's contribution to political debate, including David Cameron who spoke of his "huge talent and passion".

On referendum night, 28 of Scotland's 32 local authority areas voted in favour of staying in the UK.

Glasgow, Scotland's largest council area and the third largest city in Britain, voted in favour of independence by 194,779 to 169,347.

But the the 75% turnout in Glasgow was the lowest in the country, and hoped for breakthroughs in other traditional Labour strongholds such as South Lanarkshire, Inverclyde and across Ayrshire never materialised for the nationalists.

Edinburgh, the nation's capital, clearly rejected independence by 194,638 to 123,927 votes, while Aberdeen City voted "No" by a margin of more than 20,000 votes.

Across Scotland, 84.6% of registered voters cast their ballot in the referendum - a record for a national election.

Image copyright other Image caption Mr Salmond tweeted this image of himself and wife Moira with the message: "Heading home to Strichen. With love and thanks from Moira and I for all your kind messages of support"

Image copyright Reuters Image caption No supporters celebrate after their decisive victory

Image copyright Getty Images Image caption Pro-independence supporters console one another in Edinburgh

Image copyright AP Image caption "No" campaigners were jubilant as the scale of the result became known

Mr Cameron said the Westminster parties would ensure commitments on new Scottish parliament powers were "honoured in full" after the final referendum result was announced.

He said that Lord Smith of Kelvin, who led Glasgow's staging of the Commonwealth Games, would oversee the process to take forward the commitments, with new powers over tax, spending and welfare to be agreed by November, and draft legislation published by January.

The prime minister also spoke of the implications for the other nations of the UK, and said "millions of voices of England must also be heard".

He added: "The question of English votes for English laws, the so-called West Lothian question, requires a decisive answer so just as Scotland will vote separately in the Scottish Parliament on their issues on tax, spending and welfare, so too England as well as Wales and Northern Ireland should be able to vote on these issues.

"And all this must take place in tandem with and at the same pace as the settlement for Scotland."