571.095. Confiscation of firearms and ammunition, when — exceptions. — Upon conviction for or attempting to commit a felony in violation of any law perpetrated in whole or in part by the use of a firearm, the court may, in addition to the penalty provided by law for such offense, order the confiscation and disposal or sale or trade to a licensed firearms dealer of firearms and ammunition used in the commission of the crime or found in the possession or under the immediate control of the defendant at the time of his or her arrest. The proceeds of any sale or gains from trade shall be the property of the police department or sheriff’s department responsible for the defendant‘s arrest or the confiscation of the firearms and ammunition. If such firearms or ammunition are not the property of the convicted felon, they shall be returned to their rightful owner if he or she is known and was not a participant in the crime. Any proceeds collected under this section shall be deposited with the municipality or by the county treasurer into the county sheriff’s revolving fund established in section 50.535.