The provision of care for children at two immigration detention centres has been criticised in a report.
The report criticises Dungavel's arrangements for children
Chief Inspector of Prisons Anne Owers said provision for children at the Dungavel immigration detention centre in Lanarkshire was "inadequate".
Ms Owers also attacked the "seriously deficient" protection of children at Tinsley House near Gatwick.
Home Office Minister Tony McNulty said detention must be carried out with humanity and dignity.
Ms Owers said the Dungavel centre, which holds failed asylum seekers before deportation, had failed to implement recommendations made during a visit two years earlier.
She said she was "extremely concerned" about children at the centre, and in all the immigration removal centres she had inspected.
"Obviously the detention of children is a very sensitive matter which should be exceptional and only for a very short period," she told BBC News.
"The problem was that in neither of those centres were there proper independent procedures in place so that the welfare needs of those children could be properly identified and met, and so that any serious concerns could be raised quickly."
Dungavel House is Scotland's only immigration removal centre.
At the time of the inspection in December, eight children of primary school age and under were being held, four of whom had been there for two weeks.
The report said: "It is extremely disappointing that no progress had been made in relation to independent assessment of the welfare and developmental needs of the children.
"Indeed, to some extent, the development of children was at greater risk."
The inspector blamed the government's Immigration and Nationality Directorate (IND).
She pointed out that Dungavel and Tinsley House were run by private companies.
"There is guidance available from the Immigration and Nationality Directorate on child protection, but it is not sufficiently detailed about the care that those children should need.
"But most of all what must happen, we say, is that when children are held in detention, the immigration directorate needs to make formal links with the social services department in that area."
In her report, she also highlighted the problem of "lengthy and unacceptable" journey times for some detainees under escort. One man had been to seven different places of detention within 20 days.
However, Dungavel was commended for achieving many of the recommendations made during the previous inspection.
Relationships between staff and detainees remained good and a helpful induction course had been introduced, the report said.
On Tinsley House, Ms Owers said there was no dedicated child protection officer, and inadequate criminal record checks on staff.
The privately-run centre was also attacked for weak complaints and race relations procedures.
Home Office Minister Tony McNulty said: "Detention is an essential part of an effective immigration system, but it is critical that it is done with humanity and dignity, something I am totally committed to ensuring.
"These reports raise many issues and I want to respond to the chief inspector's recommendations once we have studied both reports in full."
Speaking later on BBC Radio's Good Morning Scotland programme, he said: "In normal circumstances, children should not be kept at Dungavel more than three days maximum.
"I certainly want to get up over the next couple of weeks to see the situation for myself because I know there are sensitivities around Dungavel and people, quite rightly, take what goes on there very, very seriously."
The minister said children must be protected within the system "in more appropriate and dedicated facilities".
Linda Fabiani, deputy convener of the Scottish Parliament's cross-party group on refugees, condemned the "disgraceful" provision of care for children at Dungavel.
"This report is a damning indictment of the centre and the Scottish Executive's policy on the handling of asylum seekers," the Scottish National Party MSP said.
"The executive must now tell the Home Office that it is not acceptable that these children are being failed on Scottish soil and demand action now."
The Scottish Socialist Party MSP, Rosie Kane, said: "Dungavel detention centre is Scotland's national disgrace.
"The detention of innocent men, women and children on Scottish soil is an abuse of human rights, of the right under international law to seek asylum.
"The detention of children is absolutely barbaric."