First Minister Nicola Sturgeon was first to speak, calling on voters to back her SNP to protect Scotland - which voted to stay part of the European Union in 2016 - from an “extreme Brexit”.
She also argued supporting the SNP would “protect Scotland’s right to make our own decisions” with regard to an independence referendum.
Tories, Labour, the Liberal Democrats and Ukip all oppose a second independence referendum, with Prime Minister Theresa May having said recently that a fresh ballot should not take place until there is “public consent” for it and until the Brexit process has played out.
Scottish Conservative leader Ruth Davidson claimed the General Election was a “massive opportunity” which gave Scotland “the chance to move on from the divisions of the past”.
The Tory MSP said: “Nicola Sturgeon said she is putting independence at the heart of her campaign - I say enough. Fix our schools, don’t split up our country. Champion our businesses, don’t put a border at Berwick.”
She told viewers watching the BBC debate: “At this election we can send the SNP a message they can’t ignore and with your help we can stop them and in so doing we can get back to the issues that really matter.”
Kezia Dugdale, the Scottish Labour leader, said despite Scots having voted against independence and Brexit in 2014 and 2016 respectively, “what we’ve got is hard Brexit and the SNP hellbent on a second independence referendum”.
She said: “I want a Labour government, but if the polls are right the Tories will be back and they will be more destructive than ever before.
“So who do you want to stand up to the Tories? Labour MPs who understand your life because they’ve lived or SNP MPs who will use every bit of Tory cruelty to exploit the case for independence.
“You can reject the Tories and a second independence referendum by voting Labour on June 8.”
But Ms Sturgeon told Scots: “You can choose MPs who will do what Theresa May wants or SNP MPs who will stand up for Scotland.”
She said representatives from her party are vital at Westminster to “keep a Tory government in check - a Tory government we know from long experience will not have Scotland’s best interests at heart”.
The SNP leader said: “A vote for the SNP will back our plans to end the Tory cuts that are holding our economy back, damaging our public services and putting more people into poverty.
“A vote for the SNP will strengthen Scotland’s hand against an extreme Brexit and a vote for the SNP will protect Scotland’s right to make our own decisions.”
Willie Rennie, the leader of the Scottish Liberal Democrats, said the June 8 vote was the chance to “build a brighter future” and to “turn away from another divisive referendum and a damaging hard Brexit”.
He claimed: “In so many seats across the country it is a straight choice between the Liberal Democrats and the SNP.
“We can win those seats, we can change the direction of the country, we can have that brighter future.”
Meanwhile Scottish Green co-convener Patrick Harvie warned social and environmental rights that were guaranteed in the EU would be “in the hands of a hard right Tory government hellbent on a bonfire of the regulations”.
He added: “We also need to oppose their cuts agenda, it’s destroying people’s lives, but it’s also a failure to invest in the sustainable future our economy needs.”
Ukip’s Scottish leader David Coburn used his opening statement to make the case for leaving the European Union.
He said: “Ukip is the party of Brexit. We must elect Ukip to the Commons to ensure Brexit means exit.”
He also stressed: “Ukip is the party of the British Union - we are completely opposed to a second Scottish independence referendum.”
In a heated exchange, Ms Sturgeon accused the Scottish Conservative leader of using independence as a smokescreen for “toxic” policies.
She said: “[Ruth Davidson] says I talk about nothing else, the truth is she talks so much about independence that I can’t get a word in edgeways about it.
“Ruth Davidson is using independence as a smokescreen in this campaign because she knows the Tory record and Tory policies are toxic.”
Ms Davidson urged the SNP leader to ditch plans for a second independence referendum.
She said: “The country said ‘No’ and you won’t listen to them.”
Ms Dugdale also urged the SNP leader to drop the independence referendum.
She said: “We answered the question in 2014. We spent two-and-a-half years debating and we said ‘No’. People want to move on from that.”
Mr Rennie said the SNP’s focus is “always independence”.
He said: “It took 44 days for Nicola Sturgeon to publish her Bill on another independence referendum. It took 15 months for them to write their mental health strategy.
“It took two years for us to persuade them to expand nursery education for two-year-olds and it took six years for us to persuade them about a pupil premium.
“For the SNP its always, always about independence. Today Brexit is the excuse, every other day it could be any other excuse at all.
“They need to cancel this second divisive independence referendum because it’s dividing our country and setting us back.”
During the debate Ms Sturgeon came under fire on education from teachers in the audience
Less than half of Scotland’s 13 and 14-year-olds are performing well in writing, according to a new survey.
With the SNP having been in government in Scotland for 10 years now, Ms Sturgeon said she was “proud of the fact that we’ve got record exam passes in our schools”.
But one woman claimed that had happened because exams were getting easier.
The audience member said: “I’m a teacher myself, I teach maths. You talk about record Higher and and Advanced Higher passes, well that is going to happen if you lower the standard of exams.
“The standard of exams going out is absolutely disgraceful. If you’re going to lower the standard of exams, you would see passes rising.”
Another teacher told the First Minister a fifth of children leave primary school without basic literacy and numeracy skills.
“Education is needing to be completely revamped,” he said.
“We need to get back to making sure our children leave primary school with the basic skills.”
While education is devolved to Holyrood, Mr Harvie stressed the impact that decisions at Westminster can have on learning.
The Green MSP said: “If young people in schools are turning up hungry and spending their days hungry, they’re not going to be able to get the best out of their education and the UK Government is pushing thousands more families deeper into poverty.”
Mr Coburn accused Ms Sturgeon of making “mincemeat” out of the Scottish education system.
He said: “We’ve got people coming out of school that are not being properly educated.”
The SNP leader also faced tough questions from a nurse who said she had to use foodbanks due to years of a pay freeze.
She said: “There’s thousands and thousands of nurse positions unfilled and the reason for that is it’s such low pay. It’s just not a sustainable income, we can’t live on it.”
She said that colleagues were considering leaving nursing, adding: “You have no idea how demoralising it is to work in the NHS.”
The audience member added: “Do you think that is what nurses go into nursing for?
“I am telling you now I would rather leave nursing, as would many of my colleagues, than have to strike. You have no idea how demoralising it is to work within the NHS.”
She made a direct plea to the First Minister, saying: “Don’t come on your announced visits, come in in the middle of any day to any ward, to any A&E department and see what we’re up against.
Ms Sturgeon said: “We’ve had in the public sector, not just in the NHS, in the last few years a 1% pay cap.
“The reason for that has been austerity policies, we’ve tried to protect jobs in the NHS and the wider public sector.”
She said with rising inflation the pay freeze is “not sustainable moving forward” and said the government would negotiate with unions on public sector pay.”
The SNP leader continued: “My sister works in the National Health Service, believe me she tells me exactly what she thinks about these matters.”
And while she said there had been a “really difficult period with public spending,” she also stressed that the Scottish Government had a policy of no compulsory redundancies in the NHS and wider public sector.
“There have been many people in the NHS in England who have lost their jobs, that hasn’t happened in Scotland,” she said.
With inflation rising she also called on Westminster to act to end the “unsustainable” freeze on benefits.
On the issue of benefits Ms Sturgeon said: “Disabled people are being dragged to assessment where they are treated like criminals and asked to justify themselves, all while the Tories are proposing even more reductions to corporation tax and tax cuts for the richest people in our society.
“It is utterly shameful that the policies are driving more disabled people into poverty. I really think the debate should not end tonight without Ruth Davidson having to defend these outrageous, despicable, cruel and callous policies.”
The Tory leader told her more people are receiving Personal Independence Payments (PIP) at the higher rate than received the previous form of support, the Disability Living Allowance.
She also insisted the new system had “more focus on people with mental health issues” and 70,000 more people benefit from a Motability car than in 2010.
The UK Government is also investing money to help disabled people into work, she said, “because they want to be independent and they want to work”.