Robert Boyd, 45, claimed he thought he was a female elf when he held up staff at the Orchid lingerie shop in Belfast.
He told the court that he had been involved in a role-playing game and had lost touch with reality. He believed himself to be Buho the elf.
His lawyer explained that Boyd was suffering from depression at the time of the robbery.
The judge was not amused and said, "I have to get back to the basics - it's a very serious offence with very serious consequences".
After his two-year prison sentence Boyd will serve another two years probation.
Read more about the robber of lingerie