Scotland's First Minister Nicola Sturgeon has warned Prime Minister Boris Johnson he cannot keep Scotland in the United Kingdom against the country's will.

Key points: Mr Johnson remains opposed to a second independence referendum for Scotland

Mr Johnson remains opposed to a second independence referendum for Scotland With Brexit looming, Ms Sturgeon says Scotland wants the right to choose its own future

With Brexit looming, Ms Sturgeon says Scotland wants the right to choose its own future Labour Party leader Jeremy Corbyn has apologised for his party's crushing defeat in the UK election

Scots voted in an independence referendum in 2014 to remain in the United Kingdom, but they also voted in the 2016 Brexit referendum to stay in the European Union, while a majority of English and Welsh voters supported leaving the bloc.

Ms Sturgeon demanded another independence referendum on Friday (local time), after her Scottish National Party (SNP) won a better-than-expected 48 out of Scotland's 59 seats in the UK Parliament in Thursday's UK election.

Mr Johnson's Conservative Party won a resounding victory, claiming 365 of the 650 seats in the House of Commons. Labour took 203 seats, its worst total since 1935.

Mr Johnson told Ms Sturgeon on Friday he would not agree to another independence vote, with the Scottish public having already backed remaining in the United Kingdom in a 2014 poll.

Protesters wave EU flags as they take part in a demonstration to demand a vote on the Brexit deal between Britain and the EU in Edinburgh. ( Reuters: Russell Cheyne, file photo )

"The Prime Minister made clear how he remained opposed to a second independence referendum, standing with the majority of people in Scotland who do not want to return to division and uncertainty," Mr Johnson's office said in a statement.

"He added how the result of the 2014 referendum was decisive and should be respected."

Loading

But Ms Sturgeon said Mr Johnson needed to "focus on reality" and recognise the Scottish National Party (SNP) had been given a mandate for a second independence referendum.

Ms Sturgeon said on Twitter she had told the Prime Minister her political mandate to give people a choice must be respected, "just as he expects his mandate to be respected"

And she told the BBC's Andrew Marr Show, "If he thinks … saying no is the end of the matter then he is going to find himself completely and utterly wrong."

"You cannot hold Scotland in the union against its will ... If the United Kingdom is to continue it can only be by consent. And if Boris Johnson is confident in the case for the union then he should be confident enough to make that case and allow people to decide."

Ms Sturgeon said on Friday her semi-autonomous Government in Edinburgh would next week publish a detailed case for a transfer of power from London that would allow her to hold a second independence referendum.

"Scotland very clearly wants a different future to the one that's been chosen by much of the rest of the UK, and Scotland wants to have the right to choose its own future," she said.

Corbyn apologises for Labour's defeat

Meanwhile, Labour Party leader Jeremy Corbyn apologised on Sunday for his party's crushing defeat in the British general election but defended his campaign, which failed to resonate with the party's working-class base, as "one of hope rather than fear".

Mr Corbyn has pledged to stand down as the decimated party's leader and the manoeuvring to replace him has begun.

"I'm sorry that we came up short and I take my responsibility for it," Mr Corbyn wrote in a letter published in the left-leaning Sunday Mirror newspaper.

But he also said his party's ambitious, big-spending policy platform was popular and criticised the British media for its portrayal of Labour.

Labour leader Jeremy Corbyn took responsibility for his party's election defeat. ( AP: Thanassis Stavrakis )

"I remain proud of the campaign we fought. I'm proud that no matter how low our opponents went, we refused to join them in the gutter," Mr Corbyn wrote. "And I'm proud that our message was one of hope, rather than fear."

Mr Corbyn was widely criticised for his perceived tolerance of anti-Semitism in his inner circle.

Mr Corbyn's policies failed to energise voters weary of more than three years of political wrangling over Britain's divorce from the European Union.

Mr Johnson's campaign, meanwhile, revolved around three words: "Get Brexit done."

Mr Johnson's 80-seat majority means he is well placed to complete the first part of that Brexit process by pushing through legislation in time for Britain to leave the EU by the January 31 deadline.

Deputy Finance Minister Rishi Sunak said Mr Johnson intended to bring back Brexit legislation to Parliament before Christmas.

"The overriding mandate that we have from this election is to get Brexit done … We will leave the European Union in a matter of weeks, by the end of January. Our intention is to bring the withdrawal bill, the legislation, back to Parliament before Christmas," Mr Sunak told the BBC's Andrew Marr Show.

Reuters/AP