Michael Reynolds, 51, of Castledine Street caused a school to be locked down and roads to be cordoned off during the incident on November 11, 2020.
He was arrested and charged with possessing a firearm, with intent to cause fear of violence.
Reynolds was given a hospital order by a judge at Leicester Crown Court after he was found unfit to plea.
Judge Keith Raynor ruled Reynolds would be given the order under section 39 of the Mental Health Act, to ensure he continues to receive psychiatric treatment in a medium secure hospital.
He said: "I determined at an earlier hearing he was unfit to plead, having considered psychiatric evidence in the case and a jury determined he did 'the act,' namely being in possession of the firearm.
Judge Raynor said Reynolds had a "well documented mental health history" and that reports from two psychiatrists confirmed he was suffering from mental illness.
In September last year, Reynolds was transferred from prison to the hospital where he is now receiving treatment.
The judge said: "He's been on regular medication and is responding well and has engaged with those offering help and treatment."
He said psychiatric experts estimated that Reynolds would need between six to twelve months of further treatment before he could be gradually reintroduced back into the community.
The judge said the Reynold’s condition included schizoid symptoms with paranoid delusional beliefs, auditory hallucinations and a manic depressive mood.
What happened on November 11, 2020 in Quorn?
Reynolds was seen by motorists standing in the middle of Sarson Street holding an air rifle, before making his way towards Barrow Road.
He raised the rifle at the corner of Sarson Street and pointed it towards a bus stop near the school. A number of sixth-formers and a member of staff were nearby at the time.
He then approached the Co-op shop on the High Street where staff had already locked the doors to protect everybody inside.
After a swift response from witnesses calling the police, armed response officers arrived and told Reynolds to drop the gun, which was later found to have been loaded.
Reynolds was shot with plastic bullets, before being arrested and taken into police custody.