The Naked Rambler left by Edinburgh Sheriff Court's backdoor

Stephen Gough, 48, was allowed to walk free from court after 20 months in prison for a series of breach of the peace offences related to nudity.

The sheriff said he was giving him the chance to end his "vicious circle".

He warned Gough he would be re-arrested if he failed to cover up. He was arrested six steps from the court.

Gough, of Eastleigh in Hampshire, emerged at 1445 GMT wearing just a rucksack and an untidy beard.

The original charges against Gough relate to his naked walk from Land's End to John O'Groats which began in June 2005.

Gough completed that trek for the second time in February 2006.

But the nine months it took him to complete the journey were interrupted by numerous arrests and spells in custody.

'Solitary confinement'

Gough has been in Saughton Prison, Edinburgh, almost without a break of more than a few minutes, since May 2006 after refusing to wear clothes in court when answering charges relating to the naked ramble.

In November last year, Sheriff Kenneth Maciver found Gough guilty of committing a breach of the peace by walking in St Leonard's Hill in the city without clothes on, after his release from a police station.

Sentence had been deferred for a psychiatric assessment and to give Gough the opportunity to reconsider his position.

When the case was called on Friday, the sheriff was told that Gough was still refusing to dress.

The only person who can bring this to an end is Mr Gough himself

Sheriff Kenneth Maciver

Edinburgh Sheriff Court

Sheriff Maciver said the view of court, including the High Court, was that members of the public should not have to tolerate completely naked persons in full view on public streets.

The sheriff said: "Mr Gough's position is that he is entitled and has the legal and moral right to be naked in public and the public have no reason to be concerned about his nakedness.

"He takes the view that the courts are wrong".

Gough, he pointed out, was kept in solitary confinement in prison because he refused to wear clothes.

This was not good for the prison authorities in terms of management and not good for him in terms of his general health, the sheriff said.

'Free choice'

"I am trying to bring this vicious circle to an end " said the sheriff.

"The only person who can bring this to an end is Mr Gough himself.

"He can end this by simply making his own free choice to put on his clothes like the rest of the population and to go home, or to go back to prison."

Sheriff Maciver deferred sentenced on Gough until 16 April to be of good behaviour and ordained him to appear.

He added: "He will be completely clear of the justice system and free to make the choice about his future."

If Gough had been in no further trouble at the end of the three month period, Sheriff Maciver said he would deal with the matter without Gough having to come to court, but if he carried on with his conduct of not wearing clothes, he would have to accept the consequences.

Less than two hours later, Gough emerged from the rear of the court building, still naked, to be met by police officers and the press.

He was arrested, and before being placed in a police van, was asked if he had any comment to make.

He said: "You have taken me by surprise. Where is the freedom?"