A robber draped in a Union Jack flag claimed he carried out the raid in protest over Catholic marches in Belfast.
Peter Boyd posted on Facebook that he was going to rob a shop before he targeted the Spar in Annan, Dumfrieshire.
The High Court in Glasgow heard on Monday that he put staff at the shop through a three-hour ordeal after posting online: "Right, see you all later - am away to hold a shop hostage. I won't be able to reply. 8-inch knife with my name on. C'mon you c****. Get armed response now. C'mon t**g f******."
The 27-year-old also made comments about Irish Republicans and the Police Service of Northern Ireland before targeting his local shop while armed with two knives.
In a final posting, he said: "See you all in a few months. Town is being shut down.Trust me when I say it." After his arrest, Boyd claimed he carried out the robbery in a protest at Catholics marching through a Protestant area of Belfast.
He admitted to abduction and robbery and will be sentenced at a later date. Boyd, draped in a Union Jack, targeted the Spar at around 4.50pm on August 10 this year.
The robber ordered workers Carole Patterson, 32, and 29-year-old Casey Donaldson to close the shutters and lock the doors. A customer was also ordered out, but Miss Patterson whispered to him to call the police before he left.
Officers arrived before the area was cordoned off. A firearms team and police negotiator attended. Prosecutor Murdoch MacTaggart told the court: "He informed them that the reason why he was doing this was to protest against Catholics marching through a Protestant area of Belfast the previous night."
Boyd then demanded the CCTV be switched off and said the doors should be barricaded with trolleys and bread baskets. Mr MacTaggart added: "He told them that if the police came in he would have to put a knife to one of their necks."
The advocate depute also told how Boyd seemed "pleased" by the large number of police officers who had responded to the robbery. Later that night, the police negotiator telephoned the shop to speak to Boyd. While he was on the call around 7.20pm, shop worker Miss Patterson bravely grabbed the knives he had left on the floor before she and Miss Donaldson fled the store.
Several hours later Boyd finally surrendered himself to officers. The court heard how the two women were left "very frightened" after their ordeal, but were fortunately found to be un-injured. Judge Lord Turnbull remanded Boyd in custody and deferred sentencing for reports.
People who read this story also read
- Helicopter investigators find 'no engine failure' in Clutha pub crash
- Jimmy 'Jinky' Johnstone Faberge egg up for auction in Glasgow
- STV poll: Should Scotland be an independent country? Yes 34% No 57%
- Psychotic patient tried to drown man 'he thought was the devil'
- Funerals for two victims of police helicopter Clutha pub crash held