The man identified as Md Afroz was rescued by the police from the mob that was pulling him by the hair and arrested on Monday, police sources said.
The police later seized the pistol, two magazines and four rounds from Afroz's possession.
He was arrested and charged under the Arms Act before being sent to jail, the sources said.