Five Law Lords made the announcement as they allowed an appeal by Cheong Wang, a Buddhist who landed in court after a sword and a knife were found in his bag after the bag was stolen by a thief at an Essex railway station in 2002.
A judge at Chelmsford Crown Court had directed a jury to return guilty verdicts on two counts of having an article with a blade or point in a public place - one related to a martial arts sword in its sheath and the other to a Ghurkha-style knife.
Mr Wang testified that he was a Buddhist and practised Shaolin, a martial art.
The sword was one of 18 weapons in which a Shaolin follower must become expert. He had taken the sword and knife with him on 27 February 2002 because he did not like to leave them in the place he was staying.
He was waiting for a train at Clacton-on-Sea railway station when his bag was stolen. The thief tried to deter him from calling police by suggesting the bag contained items Mr Wang should not be carrying.
After the trial judge told the jury the offences were proved and directed guilty verdicts, Mr Wang was conditionally discharged for 12 months.
The five Law Lords, quashing Mr Wang's conviction, said that "there are no circumstances in which a judge is entitled to direct a jury to return a verdict of guilty".