He then turned to the prosecution counsel Nicholas Jones and said: “Have you ever seen a barrister or a solicitor appear before these courts wearing a medal?

“Have you ever seen a barrister or a solicitor appear before these courts with badges on his gown?”

The prosecutor confirmed that he had not.

Judge Morgan said: “Here in South Wales, we had a barrister, who later became a judge, who, during the Battle of Normandy, was awarded the highest order of gallantry, the Victoria Cross.

“Did you ever see him wearing that medal? No. He would have considered it the height of vulgarity.”

Addressing the defence counsel, whose name is Alan Blacker, he said: “If you ever appear before this court dressed as you are at the moment, I shall exercise my right to decline to hear you.”

He added: “I did not raise any of these matters before this court during the trial because I am mindful of the fact that a young man has died and I did not want to interfere with the dignity of the proceedings, but if you ever appear looking like something out of Harry Potter, you can forget coming before this court ever again.”

Earlier in the trial, the judge had repeatedly reprimanded the lawyer for “giving evidence” instead of asking questions of the witnesses.

On his LinkedIn profile, the lawyer gives his name as Alan Blacker and his full title as Dr. The Rt. Hon. The Lord Harley of Counsel KStJ. DPhil.

He claims to have patented three military inventions, including a weapon known as “The Hedgehog”.

According to his profile, he is also fluent in Urdu, Gujarati, Luo, Punjabi and Hindi.

The lawyer also claims to have written an article about wearing military and civil decorations, which was published in the Royal British Legion Magazine in 2011.

He says he has been a member of nearly 30 different societies, including the Society of Model and Experimental Engineers, the Institute of Mental Health Act Practitioners, the Royal Artillery Association, the Zoological Society of London and the Ulster Historical Foundation. He also claims to have more than 30 different certificates.

Meanwhile, on Twitter, he describes himself as a “lawyer for the vulnerable”. According to his charity website, he has been described as “Mozart of the courtroom”.

He also has a website dedicated to his genealogy which claims his family have been Earls of Dublin since 1660 and Hereditary Lord Defenders of Dublin since King Sithric the Third.

Speaking after the case, Mr Blacker was quoted by the BBC as saying: "My qualifications, status and offices were brought into disrepute and I was personally very upset by the comments made towards me.

"I am shocked to the core that my position has been questioned - which is I feel reflective of the sacrifice of thousands of men who have died for the freedoms that are referred to in the title of Lord Harley for almost 1,100 years.

"For His Honour to have criticised me in such a way has hurt me deeply.

"I cannot say any more for legal reasons but I am deeply upset for what I consider were baseless and unjustified comments.

"I asked to see the judge in his chambers afterwards and he declined and now I have to take advice on the matter.

WalesOnline is part of Media Wales, publisher of the Western Mail, South Wales Echo, Wales on Sunday and the seven Celtic weekly titles, offering you unique access to our audience across Wales online and in print.