A 22-year old mentally ill undertrial created a major security scare at the National Institute of Mental Health and Neuroscience (NIMHANS) in Bengaluru on Sunday evening, after he snatched a policeman's rifle and started firing indiscriminately.

He was later shot and rushed to the hospital after four hours of high drama. He late did of bullet wounds. 

The man, identified as Vishwanath, was suffering from a mental illness and was brought to NIMHANS for psychiatric evaluation, police said.

The policemen escorting him uncuffed Vishwanath as he wanted to go to the bathroom, but after coming out he snatched the rifle from a policemen.

He then began indiscriminate firing with the .303 rifle. Unable to overpower him, the policemen then locked him in the guard room. However, he continued to shoot from the window.

It is reported that he opened fire every 10 minutes from the window, aiming directly at the nurses' bay, where one doctor and three nurses were hiding. The NIMHANS staff lay flat on the ground for several hours to save themselves from stray bullets.

After over four tense hours, Vishwanath was shot and critically injured by the commandos of Karnataka's anti-terrorism special force - Garuda Squad.

Police told The Hindu that the commandos shot at Vishwanath after failing to convince him to give up the weapon. He was shot through the window. 

Vishwanath was lodged at Parappana Agrahara prison for the last three years in a case of murder and arson.  

The police said he fired around 29 rounds before he was neutralised. There were no reports of any causality.