A Wigan dad threatened to gun down staff and patients at a doctors' surgery, sparking a police lockdown a court heard.
Staff desperately tried to find a panic switch to call for help, fearing someone would be hurt.
Wigan magistrates heard Philip Little went to Shevington Surgery on July 3 to ask to be taken off the register.
Receptionist Claire Benson asked him some routine questions but he became irritated and started shouting and swearing.
“He said he had mental health problems and wanted his details to be removed from the NHS system.
Katie Beattie, prosecuting, said the 35-year-old told Ms Benson he had a shotgun in his car and made reference to going to shoot someone.
She said: “He kept asking her to take him off the register, otherwise he would get his gun and shoot her and all the patients.”
Ms Benson tried to calm him down, while also trying to find the panic button to summon help.
Reading a statement from Ms Benson, Ms Beattie said: “I was concerned that if he was telling the truth, he was going to shoot someone. I didn’t want him to leave. I hoped someone would phone the police.”
Colleague Catherine Conway was assisting a patient at the counter, but asked her to sit down when she became aware of what was happening and found the panic button.
Little, who has a son, kicked some plastic containers, one of which hit Ms Benson and cut her finger, before vaulting the counter and into the staff area.
He asked if he had been removed from the register and when Ms Benson said he had, he jumped back over the desk, kicked a door and left.
The court heard Ms Benson was now “nervous” at work, given how easy it was for Little to jump behind the counter.
Police went to his home on Knightscliffe Crescent, Shevington, and searched for a gun but found nothing.
Little said he had been struggling with mental health problems for some time and had not slept for two days before the incident.
Nick Woosey, defending, said: “It’s a genuine remorse that my client has. He understands the effects it’s had on those around him.
“My client has had a long history of mental health issues. There are times he has asked for help and felt it wasn’t there.”
He said Little’s medication had been adjusted after the incident and he had made some progress.
Little pleaded guilty to assault and using threatening or abusive words or behaviour.
Magistrates handed down a 12-month community punishment, with a 12-month mental health treatment requirement, 15 rehabilitation activity days and an eight-week curfew from 9pm to 7am.
Little was ordered to pay £150 compensation to Ms Benson and an £85 victim surcharge.