Scottish party leaders have demanded apologies for their rivals' records in government as they faced off in the first televised general election debate north of the border.

The showdown, live on STV, featured SNP leader Nicola Sturgeon, Scottish Conservative leader Jackson Carlaw, Scottish Labour chief Richard Leonard and Scottish Lib Dem leader Willie Rennie.

The First Minister and the Scottish Liberal Democrat leader traded early blows over the SNP's record in government at Holyrood and the Lib Dems' time in coalition with the Tories at Westminster.

Questioning Lib Dem manifesto policies pledging billions of investment, Sturgeon said: "The Liberal Democrats were the co-architects of austerity.

"The Scottish budget is £1.5bn lower because of Liberal Democrat and Tory austerity."

She said the Scottish Government spent more per head of population on health than the rest of the UK and has increased the number of police officers in Scotland despite cuts in England.

"So despite austerity, it's the SNP government that have been investing in the progressive policies and in our public services," the SNP leader said.

"And if we can get an end to austerity, we can do even more."

'You've been in power for 12 years and look at the state of the public services in Scotland.'

Willie Rennie to Nicola Sturgeon

But Rennie replied: "You've been in power for 12 years and look at the state of the public services in Scotland. Look at the state of them.

"It's shocking. Mental health services are in a terrible state...

"You should not be proud of your record in government, Nicola. You should be ashamed of your record of government."

She shot back: "You should be ashamed of what you did in government. You should be apologising for it."

Leonard asked Carlaw to apologise for the policy of universal credit, which he claimed had pushed "tens of thousands of families across Scotland into poverty".

But the Scottish Tory leader defended the policy as one which has helped put "a record number of people into work".

The Scottish Labour leader told Carlaw: "The United Nations rapporteur described your party's reforms as an ideological project causing pain and misery, enforced by ministers in a state of denial.

"You're in a state of denial, aren't you?"

Carlaw answered: "Have there been concerns about the way it's been introduced? Yes.

"Do I think universal credit is still the right way forward, investing in getting people back into work? Yes.

"Having a job is the best form of benefit you can have."

Leonard said the policy had been a "disaster", asking: "How can you in all conscience ask people to vote for five more years of that?"

Carlaw said Labour's spending pledges of "zillions of billions of investment you can't tell us where it's coming from would plunge this country right back to the levels of unemployment we saw in the 1970s".

The Tory MSP, along with Rennie, also attacked Sturgeon and her government’s record with public services.

They pointed to the contaminated water scandal at Glasgow’s flagship Queen Elizabeth University Hospital, as well as a PISA report showing standards of maths and science are dropping in schools compared to other countries.

The SNP leader said she was focused on resolving the “serious” issues at the hospital, and said Tuesday’s education study also showed her government was closing the attainment gap.

The four leaders clashed further over Brexit and independence as voters prepare to go the polls next week, in what has been dubbed by commentators the "Brexit election".

Leonard was challenged on Labour's policy of negotiating a new deal with Brussels and then putting it back to the people in a referendum, with remaining also an option.

He told the debate: "We are now the only party which is standing for government which is offering the choice back to the people.

"We've got the Liberal Democrats who say they want to revoke Article 50, turning their back on the 52% of people who voted to Leave.

"Jackson Carlaw wants to press ahead with a hard deal, no-deal Brexit if necessary and Nicola wants to go to a second independence referendum."

Sturgeon replied: "I want Scotland to have the right to choose its own future."

On Corbyn, she pressed Leonard: "Is he Leave or Remain?"

Leonard replied: "Well, look he's decided he will take a neutral position."

Turning to face the Scottish Labour leader, Sturgeon said: "You can't even keep a straight face when you're answering this."

Leonard said: "We've had three prime ministers who've been unable to get this deal done and to get things moved on with Brexit. We are putting the choice back to the people."

Carlaw interrupted: "We've got one that will get the deal done now."

The Scottish Tory leader added: "You're also unclear on independence, because the only thing you seem to be debating any longer is the date you're going to give the referendum to Nicola Sturgeon.

"I mean, have the two of you swapped phone numbers tonight? Because she wants to pick up the phone to you the minute the result is over so that you can surrender there and then."

Rennie said: "What we need to do is to stop Brexit and stop independence because people are just fed up with the constitutional division in this country.

"They're fed up with all the arguments, they know that it's going to cause damage.

"And what they don't want to do is within weeks - this is what Nicola Sturgeon wants to do - she wants to have another independence referendum.

"She's learnt none of the lessons about Brexit. She's going to repeat it all over again and that's the last thing this country needs."

Sturgeon answered: "Willie Rennie wants people across the UK to have the chance to change their mind on Brexit - I happen to agree with him.

"But he thinks Scotland should just have to put up with Brexit no matter how Scotland voted."

The First Minister said Scotland's "future is on the line" at this election in her opening statement, describing Boris Johnson as "utterly unfit to be Prime Minister".

Returning to this theme in her closing statement, Sturgeon said: "In Scotland, the SNP is the challenger in every Tory held seat. We are the only party that can beat them.

"So vote SNP on December 12 to escape Brexit, lock Boris Johnson out of Downing Street and put Scotland's future in Scotland's hands - so that we can build the better, fairer country we know is possible."

Carlaw said that in 2020, politicians should be focused on "the things that matter to you" - like the NHS, education and jobs.

He insisted: "This is for real. Next week, the union is on the ballot paper."

In his closing statement, the Scottish Tory leader added: "Next Friday, do you want Jeremy Corbyn in Number 10, with Nicola Sturgeon pulling the strings and a second independence referendum?

"If your answer is No, the only party with the strength to stand up for you is the Scottish Conservatives.

"I'm not asking you to sign up on the dotted line to the Tory party - I'm asking you to lend us your vote next Thursday."

The Scottish Labour leader said the vote on December 12 is a "straight choice" between a Labour or a Tory government, with his party offering "an agenda of hope".

In his closing statement Leonard said: "That's a choice between another decade of cuts or a new decade of investment.

"And only a Labour Government will get to work next Friday in bringing about the real change that Scotland needs.

"We are always stronger when we stand together because when Labour wins, Scotland wins."

Opening the debate, Rennie said his party wanted to invest in mental health services and childcare at a UK-level.

In closing, he said: "You've heard tonight that the Liberal Democrats speak for the majority who want Scotland in the United Kingdom and the European Union.

"We've had enough of the economic damage and division but you have the power in your hands to make it stop."

Arriving at STV's studios in Glasgow, the leaders were greeted by the company's chief executive Simon Pitts.

A small group of protesters gathered outside the building demonstrating against cuts to homelessness services in Glasgow, speaking to each of the politicians in turn.

Neither the Scottish Greens, the Brexit party or UKIP took part in Tuesday night's debate.

However, Scottish Greens co-leader Patrick Harvie and the Brexit party's Sebastian Leslie appeared on Scotland Tonight last week.