A judge has dismissed a legal challenge against Scottish government proposals to appoint a "named person" for every child under 18.
It was brought by a coalition of charities and individuals who argued it breached human rights.
In a judgement issued at the Court of Session, Lord Pentland said the case "fails on all points".
The Scottish government says the proposals would help vulnerable children and families in need.
They are contained in the Children and Young People (Scotland) Act 2014, and are due to come into force in 2016.
Each child under 18 will be assigned a "named person", such as a teacher or health visitor, to ensure their welfare.
But a coalition of charities - the Christian Institute, Family Education Trust, The Young ME Sufferers Trust and Care (Christian Action Research and Education) - had joined parents James and Rhianwen McIntosh, from Bonnybridge, and Deborah Thomas, from Comrie, in seeking a judicial review of the policy.
Their counsel argued at the Court of Session that the provisions were outwith Holyrood's powers, breached human and constitutional rights and amounted to "unjustifiable interference by the state".
Aidan O'Neill QC told the court: "The named person provision does not allow for opt-out.
"They are compulsory in application and are not necessary in terms of child protection."
'Sense of proportion'
He said the proposals were not about child protection issues, but rather a "much more amorphous and lower standard of well-being", and that a child's well-being was a matter for the parents and family.
In his judgement, Lord Pentland said the case "fails on all points".
He said the coalition had failed to show the provisions were incompatible with rights under the European Convention on Human Rights (ECHR).
"It is important to keep a sense of proportion and balance and not to assume that the new service will operate in a way that is inappropriately invasive or disrespectful of private and family lives," he said.
"In the great majority of cases the practical effect of allocating a named person to a child or young person is likely to be minimal."
He said at the most general level the objective of the measure was to promote and safeguard the wellbeing of all children and young people in Scotland, which was clearly a legitimate aim.
He added: "There is no reason to suppose that named persons will intrude inappropriately or to an excessive degree in the lives of children and young persons or that they will act in a manner likely to undermine family life."
The Scottish government welcomed the judgement.
Children's Minister Fiona McLeod said: "Named persons are being introduced because parents and children asked for them, as a single point of contact.
"They will build on the kind of supportive role that teachers, doctors, nurses and health visitors have long offered to children and parents. The service has been tested and is already working well in several areas of Scotland."
A spokesman for the coalition No To Named Persons (NO2NP) said it was considering an appeal.
He said: "Our case is strong, as is our resolve.
"We have the opinion of one judge on this matter but it is often the case that when such important and fundamental issues are being considered the matter goes before a bench of three or more.
"We were well aware when we embarked on this campaign that it could be a long and tortuous process involving more than one court case. We are prepared for that and are in this for the long haul."