A drunk opened fire in a hospital casualty department after being made to wait for an hour.
Stephen Evans fired a ball bearing pistol six times before he was wrestled to the ground at St James' Hospital.
* Click here to sign up to free news and sport email alerts from your YEP.
Evans, 40, was drunk and claimed to have swallowed 36 paracetamol tablets when he went in to the A&E department, telling staff he had taken an overdose.
* Click here to follow the YEP on Twitter.
Leeds Crown Court heard he kept asking the receptionist how long he would have to wait.
Conor Quinn, prosecuting, said after an hour he went up to the desk and
refused to sit down.
He then pulled a black gun from his pocket and continued to stand by the desk with it.
A man nearby punched Evans in the head and wrestled him to the floor. Mr Quinn said Evans fired the weapon six or seven times during the struggle.
Witnesses described the noise as similar to firecrackers being set off.
Police were at the hospital on a separate matter and ran to the scene after hearing the shots.
Evans was arrested and more ball bearings were found in his pocket.
The receptionist and the man who tackled Evans were left badly shaken by the incident.
Evans was apologetic when interviewed by officers.
He said he had forgotten he had the weapon in his pocket after spending the day drinking and taking the tablets when he got "fed up".
Evans, of Garton Terrace, East End Park, pleaded guilty to possession of an imitation firearm.
Michael Greenhalgh, mitigating, said Evans had a drink problem and a depressive illness.
He said he was due to begin a detox programme and was seeing a doctor every week in a bid to address his problems.
Mr Greenhalgh urged judge James Spencer to impose a community punishment so Evans could access the treatment he needed.
Evans was given a nine month prison sentence, suspended for 12 months, and a 12 month community order with a requirement to attend an alcohol
Judge Spencer told Evans: "The reason I am not sending you to prison today is because I am quite satisfied that you were suffering a degree of mental instability at that time. That is why you acted in this silly manor.
"I am quite satisfied that if you receive the appropriate support from the probation service and these specific activities, it may be that you can cope with life a bit better so you do not behave like this in the future."