28/07/2016 - Judges at the UK's highest court have ruled against the Scottish government's Named Person scheme.
Opponents of the scheme appealed to the Supreme Court in London after their case was dismissed by the Court of Session in Edinburgh last year.
The system would appoint a named person - usually a teacher or health visitor - to ensure the wellbeing of every child.
Judges say some proposals breach rights to privacy and a family life under the European Convention on Human Rights.
The court said the aim of the Act, which is intended to promote and safeguard the rights and wellbeing of children and young people, was "unquestionably legitimate and benign".
However, judges said specific proposals about information-sharing "are not within the legislative competence of the Scottish Parliament".
The court has given the Scottish government 42 days to set a timetable to rectify the legislation, saying that in the meantime it "cannot be brought into force".
Education Secretary John Swinney said the government would move to "provide greater clarity" about information-sharing.
He said the government would start work immediately on the necessary legislative amendments.
Mr Swinney said it would be implemented nationally at the earliest possible date.
A spokesman for the group that launched the challenge said the "state snooper" scheme had been "blocked" and the government must go back to the "drawing board".
He called for "intrusive data-sharing powers" to be scrapped.
Analysis by BBC Scotland home affairs correspondent Reevel Alderson
The ruling by Supreme Court judges - two of whom are Scottish - does not mean the controversial Named Person legislation cannot ever be implemented.
It simply means the Scottish government must make some changes to the law to ensure it complies fully with the European Convention on Human Rights (ECHR).
The charities opposed to the scheme had already seen judges at the Court of Session in Edinburgh rule on two occasions that it could go ahead.
The appeal to the UK Supreme Court was on a claim that it breached ECHR.
The judges said in general terms the law - part of the Children and Young People (Scotland) Act 2014 - did comply.
But they ruled some changes are required to the scheme.
In particular the way in which information could be shared by named persons and others was ruled non-compliant.
The court has said the Scottish government must provide greater clarity about how health visitors, teachers and other professionals who will be Named Persons will share and receive information in their role.
Ministers said they will start work on this immediately.
Although the provisions of the legislation were due to be implemented at the end of August 2016, it will now be delayed until changes can be made.
Why was the legislation challenged?
The Scottish government contend that the system would help to protect young people and has accused opponents of misrepresenting the legislation, which was approved by 103 votes to nil by MSPs when it formed part of the Children and Young People Act in 2014.
The Supreme Court heard two days of evidence in March on the case.
The appeal was brought by the No to Named Persons (NO2NP) coalition, which includes the Christian Institute, Care (Christian Action Research and Education), Tyme Trust and the Family Education Trust.
They tried to convince the panel of five Supreme Court judges that the named person legislation authorised "unjustified and unjustifiable state interference with family rights".
Their arguments had previously been dismissed as "hyperbole" by the Court of Session, which said named person did not diminish the role of parents and had "no effect whatsoever on the legal, moral or social relationships within the family".
And while the Supreme Court did not oppose the legislation in principle, it said information-sharing proposals interfered with privacy and family life.
NO2NP spokesman Simon Calvert said he was "delighted" with the court's decision, saying it "proves our concerns were properly founded".
He added: "This proposed scheme was intrusive, incomprehensible and illegal.
"This ruling means the Scottish government has been blocked from implementing this scheme on 31 August. It must scrap its plan for state snoopers with intrusive data sharing powers. It has to go back to the legislative drawing board.
"The Big Brother scheme is history."
Why does the Scottish government want to introduce named person?
The Scottish government wants Scotland to be "the best place in the world for children to grow up".
It has said that most children and young people get all the help and support they need from their parents, wider family and community, but sometimes they might need a bit of extra support.
As part of its Getting it Right for Every Child strategy, the government proposed giving all children and young people from birth to 18 years access to a named person under the Children and Young People (Scotland) Act 2014.
The Scottish government says the named person is intended to be single point of contact if a child or their parents want information or advice, or if they want to talk about any worries and seek support.
They will also be a point of contact for other services if they have any concerns about a child's wellbeing.
The law had been due to come into force across the country on 31 August of this year, although the policy had already been rolled out in parts of Scotland, including Highland, Edinburgh, Fife, Angus and South Ayrshire.
Mr Swinney said the government would start work to amend the legislation "immediately", so that the scheme can still be rolled out "at the earliest possible date".
What do other parties think?
Last month, the Scottish government announced it would be "refreshing" its guidance on named person, which is due to be introduced across Scotland from 31 August.
It came as Deputy First Minister John Swinney acknowledged that some people had concerns about the implementation of the named person policy.
But Mr Swinney continued to insist named person would make it easier for families to get the help they need by providing a single point of contact.
And he accused the Conservatives - who have called for named person to be scrapped regardless of the court's ruling - of "going around for months utterly misrepresenting" the policy.
Scottish Conservative leader Ruth Davidson said the ruling was "important" and "a victory for campaigners" against "illiberal, invasive and deeply flawed" legislation.
She added: "Simply put, the SNP does not know better than parents when it comes to raising their children.
"We have consistently argued against the named person legislation on grounds of principle and practicality.
"I hope today's ruling will make the SNP stop and think again."
Labour is broadly in favour of named person in principle, but has previously called for a "pause" to ensure it is introduced "properly and proportionally".
The Scottish Greens and Liberal Democrats are also supportive of the policy.