A legal challenge to the Scottish Government's proposals to appoint a named person for every child has been heard at the UK's highest civil court.

The scheme was approved by Holyrood as part of the Children and Young People (Scotland) Act 2014 but an appeal against it has been mounted by four charities and three individuals.

Under the measure, a single point of contact, such as a teacher or health visitor, would be assigned to look out for the welfare of children under 18.

The named person is required to exercise statutory functions, including providing advice, information or support where appropriate to promote, support or safeguard the wellbeing of the child or young person.

Scottish ministers say the service will act as a safety net to help families and children if they need it while opponents argue the move breaches the human rights of parents.

Those involved in the No To Named Persons group (NO2NP) previously lodged a petition for a judicial review at the Court of Session in Edinburgh, Scotland's top civil court, challenging the lawfulness of the provisions but it was rejected.

Judges then refused a later appeal against the decision.

An appeal has now been heard in front of a five-strong panel of justices at the Supreme Court in London over two days.

The court has been asked to decide whether the provision is compatible with fundamental common law rights and the European Convention on Human Rights, and laws on the sharing and disclosure of information from Westminster and the European Union.

At the conclusion of the hearing on Wednesday, justices said they would deliver their decision in due course.

The group challenging the legislation is spearheaded by The Christian Institute, Family Education Trust, The Young ME Sufferers (''Tymes'') Trust and CARE (Christian Action Research & Education) lodged a petition alongside three individual people.

Speaking afterwards, Simon Calvert, spokesman for NO2NP, said: "We have had the privilege of a full and forensic hearing in front of the judges in the highest court in the land.

"We made detailed arguments which we firmly believe are of the utmost importance and which go to the heart of the matter - the crucial right of parents and children to a private family life and for their personal information not to be misused by organs of the state.

"We await the verdict with anticipation."

Several children's charities and professional organisations have put their name to a letter in support of the legislation.

Groups including Barnardo's Scotland, Children 1st and Aberlour said: "The campaign against the named person provisions of the Children and Young People (Scotland) Act has sought to portray the policy as a 'State Guardian' for every child and a material erosion of family privacy. This is simply not the case.

"The introduction of the named person was a direct policy response to requests from parents for a simplified approach to accessing support when they need it.

"Whilst we hope their legal challenge will fall once again, we will seek to work with those who are concerned about the policy and how it may be implemented to ensure the policy is as workable as possible and that their concerns are not realised."

A Scottish Government spokeswoman said: "This Government is absolutely committed to ensuring that all our children get the best possible start in life. Getting It Right for Every Child, which includes the named person service, is an investment in all our futures.

"It aims to change the culture and practice of professionals, giving them the confidence, skills and knowledge they need to put children's needs and interests at the heart of services and support they provide for families.

"The Supreme Court has now heard the arguments and will consider carefully before issuing its judgment in due course. It would not be appropriate to comment further on those proceedings at this stage."