A. When a defendant is accused of a misdemeanor or petty offense for which the person injured by the act constituting the offense has a remedy by a civil action, the offense may be compromised as provided in this section, except:
1. When the offense is committed by or upon any officer of justice while in the execution of the duties of his office.
2. When the offense is committed riotously.
3. When the offense is committed with intent to commit a felony.
B. If a defendant is accused of an act involving assault, threatening or intimidating or a misdemeanor offense of domestic violence as defined in section 13-3601, the offense shall not be compromised except on recommendation of the prosecuting attorney.
C. If the party injured appears before the court in which the action is pending at any time before trial, and acknowledges that he has received satisfaction for the injury, the court may, on payment of the costs incurred, order the prosecution dismissed, and the defendant discharged. The reasons for the order shall be set forth and entered of record on the minutes and the order shall be a bar to another prosecution for the same offense.
D. No public offense shall be compromised or the prosecution or punishment upon a compromise dismissed or stayed except as provided by law.