The treatment of an alleged rape victim who was locked up after breaking down in the witness box was today branded "disproportionate" by Scotland's top judge.

Ann Robertson, 43, was remanded by temporary judge Sheriff Roger Craik QC earlier this year during the case against George Cummings at the High Court in Edinburgh.

She was held in police cells overnight after breaking down during the trial and struggling to deliver her testimony.

Ms Robertson, who waived her right to anonymity, complained to the Lord Justice General Lord Hamilton about her treatment.

And today he upheld her complaint and ruled that the trial judge's decision to order her detention overnight was "disproportionate" and said her experience was "traumatic".

In his response to Ms Robertson today, he said: "I have come to the view that his decision that you be detained overnight - which must have been traumatic for you - was in the circumstances disproportionate."

No further action is to be taken.

Both parties involved have now been advised of his decision.

Ms Robertson's experience led to her calling for Mr Craik to be dismissed.

First Minister Alex Salmond told Parliament he was "extremely concerned" by the case.

Ms Robertson was a Crown witness at the trial of her uncle, George Cummings in January this year.

The charge of raping Ms Robertson was eventually dropped, although the trial resulted in Mr Cummings, from Grangemouth, near Falkirk, being convicted of abusing two young girls during the 1970s.

Lord Hamilton's decision today outlined the events which led to Ms Robertson being locked up.

It noted that when she was giving evidence, she appeared to have particular difficulty in testifying.

She seemed nervous and spoke so quietly that it was difficult to hear her and she avoided eye contact with those questioning her.

She fled the witness box and left the court room without permission on two separate occasions.

The trial judge explained to her that, while he recognised that she was under some pressure and in a difficult situation, she was under an obligation to give her evidence to the court.

But further difficulties then arose during examination-in-chief and cross-examination in relation to claims made by Ms Robertson that the alleged abuse had affected her relationships as a adult.

She refused to answer certain questions put to her and would not continue with her evidence.

The trial judge, having concerns about whether Ms Robertson was fit to give evidence, ultimately decided that she should be detained overnight and medically examined.

She was, on his instructions, kept overnight in police custody.

The witness returned to complete her evidence, with difficulty, the following day.

Lord Hamilton acknowledged that the witness's behaviour put the trial judge in a difficult position, bearing in mind that he had to make sure the accused received a fair trial.

But the Lord Justice General found that while there was some risk that Ms Robertson would not return to complete her evidence if she were released, that risk was not so serious as to justify the detention overnight of a witness whose medical fitness was in question.

A stern warning to return the next morning would have been appropriate, Lord Hamilton found.

While Ms Robertson's behaviour put her at risk of being found in contempt of court, no such finding was ever made.

The Lord Justice General is arranging for judges to be informed about his decision.

But Labour's justice spokesman Richard Baker said he was surprised that no action was being taken.

Mr Baker, who wrote to the Lord Advocate to complain about Ms Robertson's treatment, said: "I'm concerned there may be a perception that this matter is being swept under the carpet.

"As it has been found that it was inappropriate for Sheriff Craik to act in this way I'm surprised myself there appears to be no clear sanction for his behaviour."