The UK and Scottish Governments have been accused of "passing the buck" in their failure to hold a public inquiry into undercover policing in Scotland.

Scotland's highest civil court heard the decision not to hold an inquiry into undercover activities north of the border was incompatible with human rights law and "the right to the truth".

Environmental justice campaigner Tilly Gifford is challenging the UK Government's refusal to extend an inquiry into undercover policing in England and Wales, led by Sir John Mitting, north of the border.

Her petition for judicial review also covers the Scottish Government's decision not to set up a separate inquiry in Scotland.

Ms Gifford, a member of the Plane Stupid campaign group, says she was targeted in Scotland in 2009 by officers who wanted to recruit her as an informant.

Aidan O'Neill QC, representing Ms Gifford, told the Court of Session in Edinburgh: "Everyone is passing the buck on this one".

The UK Government was "deaf" to concerns about activities in Scotland, he said, adding: "Cross the border, at Berwick or Gretna, and suddenly 'we're not interested, we don't care, it's nothing to do with us'.

He also criticised the reasons given by Scottish Ministers not to hold inquiry as "insufficient".

An independent review of undercover policing north of the border by Her Majesty's Inspectorate of Constabulary in Scotland (HMICS) "left areas which need to be further investigated" he said.

These included the actions by legacy forces before the creation of Police Scotland and the activities of former Metropolitan Police undercover officer Mark Kennedy in Scotland, who infiltrated campaign groups and formed romantic relationships with activists.

He added: "There are questions of concern about not only how English and Welsh police units were operating in Scotland but also how undercover operations were carried out by Scottish legacy police forces.

"There's more than a whiff of greater things going on."

As a result, an area of significant public concern was being dealt with in England and Wales but not in Scotland, and an inquiry was needed to "restore and retain public confidence", he added.

"The right to protest, the right to gather, the right of association, the right to free speech and the right not to be spied upon are fundamental in a democratic society."

He raised the possibility of a joint inquiry by both administrations.

Advocate Andrew Webster, for the UK Government, urged judge Lady Carmichael to reject the petition.

He said the action was effectively "time barred" because it had been raised 15 months after the terms of reference for the Mitting inquiry - then under Sir Christopher Pitchford - were set in 2015.

This was despite Ms Gifford's contact with undercover police having taken place "well before" in 2009.

The challenge should have been put when the terms were set but was not, he said.

Mr Webster added there was also no express general "right to truth" under the European Convention on Human Rights.

Solicitor Advocate Christine O'Neill, for the Scottish Government, said it had not been demonstrated a public inquiry was necessary in this case.

She said Ministers were entitled to take into account a range of matters when deciding whether to hold an inquiry, including its practicability.

Ms O'Neill will conclude her case at the court on Friday.

Lady Carmichael will then consider the arguments and is expected to deliver her ruling in the coming months.

Speaking after the hearing Ms Gifford said: "I'm glad that the arguments have been heard, I was worried that they would be thrown out on a technicality.

"I'm not an expert in law and I brought this case because it's more about the court of public opinion - I realise how much it matters to myself and to other people who are also victims of undercover policing.