Whenever a peremptory mandamus is directed to any public officer, body or board, commanding the performance of any public duty specially enjoined by law, if it appear to the court that such officer, or any member of such body or board, has, without just excuse, refused or neglected to perform the duty so enjoined, the court may impose a fine, not exceeding five hundred dollars, upon every such officer or members of such body or board. Such fine, when collected, shall be paid into the treasury of the county where the duty ought to have been performed; and the payment thereof is a bar to an action for any penalty incurred by such officer or member of such body or board, by reason of his refusal or neglect to perform the duty so enjoined.
Okla. Stat. tit. 12, § 1462