Scotland's new children's tsar has criticised Scottish courts for failing to give consideration to children at "any point in the process" when handing jail sentences to their parents.
Decisions to send parents to jail infringe children's right to a private and family life, as enshrined in the UN Convention on the Rights of the Child, according to Tam Baillie, Scotland's commissioner for children and young people.
In his first public appearance since taking up the role in May, Mr Baillie backed the call first made by his predecessor, Kathleen Marshall, last year in her report about the rights of prisoners' children - Not Seen. Not Heard. Not Guilty - for courts to consider the interests of children when sentencing parents.
He said: "An estimated 16,000 children are affected by the imprisonment of a parent or carer. But that's just an estimate. The truth is we don't really know (how many). The reason we don't know is we simply don't count them, and the reason we don't count them is because they are invisible."
There are more children of prisoners than looked-after children in Scotland, and their needs are neglected, said Mr Baillie, who previously worked as policy director at Barnardo's Scotland.
"They do not command the same regulation, legislation, political statements or column inches," he said.
Mr Baillie was speaking at an event organised to promote the views of Justice Albie Sachs of the South African Constitutional Court, whose landmark ruling in the case of S v M in 2007 was a major influence on Ms Marshall's February 2008 report.
Justice Sachs was in Edinburgh to talk for the first time abroad about the case of Mrs M, which led to the ruling in South Africa that when the principal carer faces jail, their children's rights can potentially save them from imprisonment.
When Mrs M's application landed on his desk, Justice Sachs's initial reaction was to draft an "extremely dismissive" memo, he told his audience at the National Gallery of Scotland. Mrs M had been convicted of credit card fraud some 100 times and had spent a total of Pounds 2,000-Pounds 3,000. She had been given chances to change, but had failed to take them and now faced four years in prison.
Justice Sachs was stopped in his tracks, however, when a colleague questioned his logic, asking: "What about the children?" This, he said, made him think about section 28 of South Africa's Bill of Rights, which states: "A child's best interests are of paramount importance in every matter concerning the child."
Mrs M had three teenage boys and was living in a "fragile" area, rife with drug-dealing and violence. She was deemed a good mother.
"It created a dent in my scepticism, and sometimes you just need a tiny perforation and all sorts of things filter in," said Justice Sachs, who campaigned against apartheid and whose leadership has been integral to South Africa's rebirth.
"The usual reasoning is, if you (a parent of carer) are worried about the children, you should have thought of them before you went on a spending spree," he said. A major change of mindset was required, Justice Sachs admitted.
In the end, he argued in his judgment that children were not a mere extension of their parents, destined to sink or swim with them.
The ruling means that now, before sentencing, South African courts are obliged to ask if minors are involved and to have a social work report compiled. In borderline cases, or "where there are alternatives to prison that promote the public order agenda at least as well" - as Ms Marshall put it in her report - parents may avoid jail.
"Even when they go to jail, the court is obliged to ensure the impact on the children is mitigated as much as possible," Justice Sachs said.
In Mrs M's case, it was decided she should repay the money and do community service, but not go to jail. She has kept out of trouble since, is running two businesses and her children attend school and after-school activities, he said.