Nicola Sturgeon has refused to rule out a third independence referendum within just a few years.

The SNP leader was challenged on the issue by a member of the public during a special edition of the BBC's Question Time Programme.

She was asked if she would guarantee that the result of a second vote would apply for a minimum amount of time, such as 25 years.

But she faced jeers from the studio audience in Edinburgh when she refused, saying it was not the the place of any politician to "dictate to a country" its future.

Read more: STV to host leaders' debate as General Election campaign nears its final stage

Earlier another audience member, Hugh Gallagher, had asked Ms Sturgeon if she accepted that she had miscalculated Scottish public opinion by calling for another independence referendum.

She denied the charge, saying that Scots should have a "choice" about an issue as large as the impact of Brexit.

While politicians often take into account public opinion "sometimes you have to be guided by principle", she added.

But there was applause from the audience as Mr Gallagher accused her of being "hopeless" at dealing with the big domestic issues facing Scotland.

Another member of the audience asked Ms Sturgeon: "Why have your poll ratings declined so much?"

And a third challenged her: "You said you want to be judged on education. So on that basis shouldn't you resign?"

The SNP leader hit back that the polls also suggested that the SNP was on track to win the election in Scotland "fairly convincingly".

Read more: STV to host leaders' debate as General Election campaign nears its final stage

She defended her record on education and the NHS but conceded "we have to make sure we address the challenges we face".

However, she said that she should not be judged on her record on education until the next Scottish Parliament elections, due in 2021.

Asked if she could put independence on the "backburner" as part of an anti-Tory alliance after the election, Ms Sturgeon repeated her belief that "at the end of the Brexit process people should have a choice".

But she was told by a woman in the audience that she was "losing a lot of votes from SNP supporters" because they do not want a referendum now.

Read more: STV to host leaders' debate as General Election campaign nears its final stage

Scottish Conservative MSP for the North East Ross Thomson said: “Once again, we’ve seen the First Minister taken to task on her party’s dreadful record on education.

"She struggled once again to explain why, after ten years in government, standards in our schools have slipped so badly.

“The reason is that this SNP Government has spent ten years obsessing about independence."

Scottish Labour General Election campaign manager James Kelly said: "This was a tough night for the First Minister.

"No wonder Nicola Sturgeon spends so much time up in her helicopter, because when she comes into contact with the ordinary people of Scotland it becomes clear that the majority don't want another divisive independence referendum.

"It's time for Nicola Sturgeon to listen to the majority of Scots, who want her to get on with the day job of improving standards in our schools and hospitals instead of constantly trying to break up our country."