A Scottish lawyer who claimed his client did not receive a fair trial on terror charges is not guilty of contempt of court, judges were told yesterday.

Aamer Anwar's defence counsel Paul McBride, QC, said that it was a "fundamental principle" of law that cases which had been concluded could be commented upon "fully and freely" without fear of punishment.

Branding the contempt case an "overreaction" by the trial judge Lord Carloway, Mr McBride said it was neither "necessary nor appropriate" for the judge to have referred the case.

He added that solicitors had a duty to fight their client's corner both inside and outside court - and judges should take such criticism without seeking to penalise anyone.

Dozens of supporters cheered and shouted "good luck" as the human rights lawyer arrived at Edinburgh High Court, then going inside into the public gallery to watch the unprecedented case.

Addressing the panel of three judges, Mr McBride said: "It is a fundamental principle that court proceedings which are concluded, having been heard in public, can be fully and freely commented upon whether to compliment and praise or whether to criticise, and in my respectful submission, either expressing his own views or those of a convicted person outwith the precincts of the court does not wilfully challenge either the authority of that court or the supremacy of the law itself."

The allegation of contempt centres on remarks made by Mr Anwar criticising a guilty verdict for Mohammed Atif Siddique, 21, who was jailed for eight years last September for a series of offences in what was Scotland's first Islamist terrorism conviction.

Standing outside Glasgow High Court after Siddique was convicted, Mr Anwar attacked the verdict as "a tragedy for justice and for freedom of speech", alleging the prosecution was "driven by the state" in an "atmosphere of hostility" after the failed terror attacks on Glasgow Airport.

Mr McBride admitted that Mr Anwar's remarks were not tactfully made but added: "It falls within the remit given to a solicitor to express his client's views after conviction."

Commenting on Lord Carloway's decision to bring Mr Anwar before the panel to face contempt charges because he had disparaged judge, jury, prosecution and the entire legal system, Mr McBride added: "The court ought not to penalise people who seek to criticise them or the decisions that they arrive at."

Part of Lord Carloway's concerns centred on the question of whether Mr Anwar's statement did actually represent the views of his client, whom he suggested was not bright enough to think it up.

However, defence counsel pointed to an affidavit signed by Siddique in which he said the tirade was a "toned-down" version of what he wanted to say.

A lawyer from human rights group Liberty was allowed to give the judges advice on freedom of speech issues, in what is thought to be the first move of its kind in Scotland.

After almost six hours of submissions Judge Lord Osborne announced that he and his colleagues, Lords Kingarth and Wheatley would consider the arguments and rule "in due course".