Shoddy security measures in court buildings are putting members of the public and prisoners at risk as well as increasing the chances of escape by criminals, it has been claimed.

A report by a prisons watchdog said procedures in many courthouses were "lax or inappropriate" and called for urgent improvements.

The report by HM Chief Inspector of Prisons into prisoners under escort also raised concerns about children being kept in prison overnight because they are dealt with too late to be placed in a social work secure unit.

Although the report found the majority of prisoner escorts, handled by security firm Reliance Custodial Services (RCS), were carried out safely, it also warned delays in the system were "endemic" and said hygiene standards in many cell and holding areas was "unacceptable".

John McCaig, Deputy Chief Inspector of Prisons, said: "The key concerns arise in locations where it is very difficult for RCS to adequately protect prisoners, or themselves, from attack by a member of the public, or where it is difficult to guarantee that a member of the public would not be able to pass an item to a prisoner.

"The layout of some courts, as well as some of the arrangements in place, expose prisoners to unnecessary public scrutiny.

"Basically, physical security of some court buildings is poor and needs to be improved."

The report itself states: "Inspectors observed a number of occasions where members of the public were in close contact with prisoners, leaving open the risk of assault or of items being passed."

Bill Aitken, justice spokesman for the Scottish Conservatives, said: "It is right we strive to create humane conditions within which prisoners can be efficiently transported, but their rights are in no way more important than those of the general public.

"That sentiment needs to be reflected in any measures that will be taken in light of this report."

Reliance took over responsibility for escorting prisoners to and from court in 2004, and carries out around 15,000 escorts every month.

The firm, that employs around 700 escort staff, was criticised following a number of high-profile mistakes that led to some prisoners being mistakenly released.

However, yesterday's report praised the "professional" way in which Reliance now carries out its job.

Though the report does highlight instances where it is possible for security to be breached when prisoners are being taken into court.

A spokesman for the Scottish Prison Service insisted "appropriate steps" were taken to ensure public safety is protected during prisoner escorts.

"There is always an element of risk, but what we have to do is assess that risk and put measures in place to ensure public safety when prisoners are under escort," he said.